Commit 37dbc20e authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

properly clean up gui on window close, remove some debugging messages

parent 208199ff
...@@ -853,7 +853,7 @@ function gui_window_close(cid) { ...@@ -853,7 +853,7 @@ function gui_window_close(cid) {
nw_close_window(nw_win); nw_close_window(nw_win);
}); });
// remove reference to the window from patchwin object // remove reference to the window from patchwin object
patchwin[cid] = null; set_patchwin(cid, null);
loading[cid] = null; loading[cid] = null;
} }
...@@ -1261,7 +1261,7 @@ exports.get_patchwin = function(name) { ...@@ -1261,7 +1261,7 @@ exports.get_patchwin = function(name) {
return patchwin[name]; return patchwin[name];
} }
exports.set_patchwin = function(cid, win) { var set_patchwin = function(cid, win) {
patchwin[cid] = win; patchwin[cid] = win;
if (win) { if (win) {
gui.add(cid, win); gui.add(cid, win);
...@@ -1270,6 +1270,8 @@ exports.set_patchwin = function(cid, win) { ...@@ -1270,6 +1270,8 @@ exports.set_patchwin = function(cid, win) {
} }
} }
exports.set_patchwin = set_patchwin;
exports.get_dialogwin = function(name) { exports.get_dialogwin = function(name) {
return dialogwin[name]; return dialogwin[name];
} }
...@@ -5190,8 +5192,6 @@ function gui_undo_menu(cid, undo_text, redo_text) { ...@@ -5190,8 +5192,6 @@ function gui_undo_menu(cid, undo_text, redo_text) {
// there may be some calls to subpatches after updating a dialog // there may be some calls to subpatches after updating a dialog
// (like turning on GOP) which call this for a canvas that has // (like turning on GOP) which call this for a canvas that has
// been destroyed. // been destroyed.
gui(cid);
post("the thing is " + gui(cid).get_elem);
gui(cid).get_nw_window(function(nw_win) { gui(cid).get_nw_window(function(nw_win) {
if (cid !== "nobody") { if (cid !== "nobody") {
nw_win.window.nw_undo_menu(undo_text, redo_text); nw_win.window.nw_undo_menu(undo_text, redo_text);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment