Index: lib/aardvark.js |
=================================================================== |
--- a/lib/aardvark.js |
+++ b/lib/aardvark.js |
@@ -248,16 +248,18 @@ let Aardvark = exports.Aardvark = |
}, |
onMouseMove: function(event) |
{ |
this.mouseX = event.screenX; |
this.mouseY = event.screenY; |
this.hideSelection(); |
+ if (!this.browser) |
+ return; // hideSelection() called quit() |
saroyanm
2015/08/10 14:58:12
Nit: I think make sense to move comment before if
|
let x = event.clientX; |
let y = event.clientY; |
// We might have coordinates relative to a frame, recalculate relative to top window |
let node = event.target; |
while (node && node.ownerDocument && node.ownerDocument.defaultView && node.ownerDocument.defaultView.frameElement) |
{ |
@@ -388,21 +390,33 @@ let Aardvark = exports.Aardvark = |
{ |
this.prevPos = pos; |
this.paintNode.addEventListener("MozAfterPaint", this.onAfterPaint, false); |
} |
}, |
hideSelection: function() |
{ |
- if (this.boxElem.parentNode) |
- this.boxElem.parentNode.removeChild(this.boxElem); |
+ try |
+ { |
+ if (this.boxElem.parentNode) |
saroyanm
2015/08/10 14:58:12
I wander if this is the only case where we are usi
Wladimir Palant
2015/08/10 21:10:11
No, it's not, and the other places might still pro
|
+ this.boxElem.parentNode.removeChild(this.boxElem); |
+ } |
+ catch (e) |
+ { |
+ // Are we using CPOW whose process is gone? Quit! |
+ this.boxElem = {}; |
saroyanm
2015/08/10 14:58:12
Shouldn't we reset this.boxElem value and paintNod
Wladimir Palant
2015/08/10 21:10:11
No, because quit() will call hideSelection() again
|
+ this.paintNode = null; |
+ this.quit(); |
+ return; |
+ } |
if (this.paintNode) |
this.paintNode.removeEventListener("MozAfterPaint", this.onAfterPaint, false); |
+ |
this.paintNode = null; |
this.prevPos = null; |
}, |
getWindowSize: function(wnd) |
{ |
return [wnd.innerWidth, wnd.document.documentElement.clientHeight]; |
}, |