diff -ru nux-4.0.6+14.04.20140409.orig/Nux/InputArea.cpp nux-4.0.6+14.04.20140409/Nux/InputArea.cpp --- nux-4.0.6+14.04.20140409.orig/Nux/InputArea.cpp 2014-04-09 15:24:31.000000000 -0700 +++ nux-4.0.6+14.04.20140409/Nux/InputArea.cpp 2014-07-29 08:21:43.364714865 -0700 @@ -65,6 +65,16 @@ InputArea::~InputArea() { + // It is possible that the window thread has been deleted before the input + // area itself, so check prior to calling RemoveObjectFromLayoutQueue. + WindowThread* wt = GetWindowThread(); + if (wt) + { + // It is possible that the object is in the refresh list. Remove it here + // before it is deleted. + wt->RemoveObjectFromLayoutQueue(this); + } + while (GetWindowCompositor().GrabPointerRemove(this)); while (GetWindowCompositor().GrabKeyboardRemove(this)); } diff -ru nux-4.0.6+14.04.20140409.orig/Nux/View.cpp nux-4.0.6+14.04.20140409/Nux/View.cpp --- nux-4.0.6+14.04.20140409.orig/Nux/View.cpp 2014-04-09 15:24:31.000000000 -0700 +++ nux-4.0.6+14.04.20140409/Nux/View.cpp 2014-07-29 08:19:56.586664702 -0700 @@ -44,17 +44,6 @@ backup_texture_.Release(); backup_depth_texture_.Release(); background_texture_.Release(); - - // It is possible that the window thread has been deleted before the view - // itself, so check prior to calling. - WindowThread* wt = GetWindowThread(); - - if (wt) - { - // It is possible that the object is in the refresh list. Remove it here - // before it is deleted. - wt->RemoveObjectFromLayoutQueue(this); - } RemoveLayout(); }