diff libgui/graphics/Panel.cc @ 22190:e68128601f5e

skip invalid objects in Qt graphics event handlers (bug #46501) * Container.cc (Container::resizeEvent): Avoid accessing properties from invalid graphics object. * Panel.cc (Panel::eventFilter): Likewise. * graphics.in.h (base_graphics_object:get_properties): Issue warning instead of error.
author John W. Eaton <jwe@octave.org>
date Thu, 28 Jul 2016 16:07:11 -0400
parents 2aef506f3fec
children bac0d6f07a3e
line wrap: on
line diff
--- a/libgui/graphics/Panel.cc	Thu Jul 28 16:54:54 2016 +0200
+++ b/libgui/graphics/Panel.cc	Thu Jul 28 16:07:11 2016 -0400
@@ -191,7 +191,11 @@
                     {
                       gh_manager::auto_lock lock;
 
-                      ContextMenu::executeAt (properties (), m->globalPos ());
+                      graphics_object go = object ();
+
+                      if (go.valid_object ())
+                        ContextMenu::executeAt (go.get_properties (),
+                                                m->globalPos ());
                     }
                 }
               break;
@@ -209,7 +213,10 @@
                 {
                   gh_manager::auto_lock lock;
 
-                  properties ().update_boundingbox ();
+                  graphics_object go = object ();
+
+                  if (go.valid_object ())
+                    go.get_properties ().update_boundingbox ();
                 }
               break;