Code

fix possible crash where event_context is destroyed during fill operation due to...
authorjohncoswell <johncoswell@users.sourceforge.net>
Sun, 16 Dec 2007 15:29:30 +0000 (15:29 +0000)
committerjohncoswell <johncoswell@users.sourceforge.net>
Sun, 16 Dec 2007 15:29:30 +0000 (15:29 +0000)
src/flood-context.cpp

index 86f6687e3dfc4e076b6bc8b028ddba537ce0858c..5838c2b59c06cb102c02407ccd8452264d734c08 100644 (file)
@@ -1044,7 +1044,7 @@ static gint sp_flood_context_root_handler(SPEventContext *event_context, GdkEven
                     event_context->xp = (gint) button_w[NR::X];
                     event_context->yp = (gint) button_w[NR::Y];
                     event_context->within_tolerance = true;
-                    
+                      
                     dragging = true;
                     
                     NR::Point const p(desktop->w2d(button_w));
@@ -1100,7 +1100,10 @@ static gint sp_flood_context_root_handler(SPEventContext *event_context, GdkEven
                 }
 
                 r->stop();
-                event_context->defaultMessageContext()->clear();
+
+                if (SP_IS_EVENT_CONTEXT(event_context)) {
+                    event_context->defaultMessageContext()->clear();
+                }
             }
         }
         break;