Skip to content

Commit 508f657

Browse files
committed
A possible fix for: #22
The default processUp might be crashi9ng.
1 parent b03d293 commit 508f657

File tree

3 files changed

+41
-31
lines changed

3 files changed

+41
-31
lines changed

docs/QuickConnection.js

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,28 @@ export class QuickConnection {
4040
// Let's not popup the release on empty spot menu if we've released the mouse on a dot
4141
const origReleaseLink = LiteGraph.release_link_on_empty_shows_menu;
4242
const origShowConnectionMenu = t.canvas.showConnectionMenu;
43-
if (t.pointerUp()) {
44-
if (!t.isComfyUI) {
45-
LiteGraph.release_link_on_empty_shows_menu = false;
46-
} else {
47-
t.canvas.showConnectionMenu = () => {};
43+
44+
let ret = null;
45+
try {
46+
if (t.pointerUp()) {
47+
if (!t.isComfyUI) {
48+
LiteGraph.release_link_on_empty_shows_menu = false;
49+
} else {
50+
t.canvas.showConnectionMenu = () => {};
51+
}
52+
t.release_link_on_empty_shows_menu = false;
4853
}
49-
t.release_link_on_empty_shows_menu = false;
50-
}
51-
const ret = origProcessMouseUp.apply(this, arguments);
52-
if (!t.release_link_on_empty_shows_menu) {
53-
if (!t.isComfyUI) {
54-
LiteGraph.release_link_on_empty_shows_menu = origReleaseLink;
55-
} else {
56-
t.canvas.showConnectionMenu = origShowConnectionMenu;
57-
t.canvas.linkConnector.reset();
54+
ret = origProcessMouseUp.apply(this, arguments);
55+
} finally {
56+
if (!t.release_link_on_empty_shows_menu) {
57+
if (!t.isComfyUI) {
58+
LiteGraph.release_link_on_empty_shows_menu = origReleaseLink;
59+
} else {
60+
t.canvas.showConnectionMenu = origShowConnectionMenu;
61+
t.canvas.linkConnector.reset();
62+
}
63+
t.release_link_on_empty_shows_menu = true;
5864
}
59-
t.release_link_on_empty_shows_menu = true;
6065
}
6166
return ret;
6267
};

js/QuickConnection.js

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,28 @@ export class QuickConnection {
4040
// Let's not popup the release on empty spot menu if we've released the mouse on a dot
4141
const origReleaseLink = LiteGraph.release_link_on_empty_shows_menu;
4242
const origShowConnectionMenu = t.canvas.showConnectionMenu;
43-
if (t.pointerUp()) {
44-
if (!t.isComfyUI) {
45-
LiteGraph.release_link_on_empty_shows_menu = false;
46-
} else {
47-
t.canvas.showConnectionMenu = () => {};
43+
44+
let ret = null;
45+
try {
46+
if (t.pointerUp()) {
47+
if (!t.isComfyUI) {
48+
LiteGraph.release_link_on_empty_shows_menu = false;
49+
} else {
50+
t.canvas.showConnectionMenu = () => {};
51+
}
52+
t.release_link_on_empty_shows_menu = false;
4853
}
49-
t.release_link_on_empty_shows_menu = false;
50-
}
51-
const ret = origProcessMouseUp.apply(this, arguments);
52-
if (!t.release_link_on_empty_shows_menu) {
53-
if (!t.isComfyUI) {
54-
LiteGraph.release_link_on_empty_shows_menu = origReleaseLink;
55-
} else {
56-
t.canvas.showConnectionMenu = origShowConnectionMenu;
57-
t.canvas.linkConnector.reset();
54+
ret = origProcessMouseUp.apply(this, arguments);
55+
} finally {
56+
if (!t.release_link_on_empty_shows_menu) {
57+
if (!t.isComfyUI) {
58+
LiteGraph.release_link_on_empty_shows_menu = origReleaseLink;
59+
} else {
60+
t.canvas.showConnectionMenu = origShowConnectionMenu;
61+
t.canvas.linkConnector.reset();
62+
}
63+
t.release_link_on_empty_shows_menu = true;
5864
}
59-
t.release_link_on_empty_shows_menu = true;
6065
}
6166
return ret;
6267
};

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "quick-connections"
33
description = "Quick connections, Circuit board connections"
4-
version = "1.0.16"
4+
version = "1.0.17"
55
license = {text = "MIT License"}
66

77
[project.urls]

0 commit comments

Comments
 (0)