From ebf8515a30e9c52ae6963aad545f04bec0f8200f Mon Sep 17 00:00:00 2001 From: David Capello Date: Sun, 25 Apr 2010 12:13:59 -0300 Subject: [PATCH] Fixed possible dead-pointers deleting a widget. --- src/jinete/jmanager.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/jinete/jmanager.cpp b/src/jinete/jmanager.cpp index 3491248f7..53524dcfe 100644 --- a/src/jinete/jmanager.cpp +++ b/src/jinete/jmanager.cpp @@ -908,11 +908,12 @@ void jmanager_free_capture() void jmanager_free_widget(JWidget widget) { - /* break any relationship with the GUI manager */ - if (widget->hasCapture()) + // Break any relationship with the GUI manager + + if (widget->hasCapture() || (widget == capture_widget)) jmanager_free_capture(); - if (widget->hasMouse()) + if (widget->hasMouse() || (widget == mouse_widget)) jmanager_free_mouse(); if (widget->hasFocus() || (widget == focus_widget))