gtk: take care of LastWPResult when we are disconnecting all widget signal handlers (must fix bug #0014512)

git-svn-id: trunk@21608 -
This commit is contained in:
paul 2009-09-08 06:58:44 +00:00
parent 273106521a
commit d43964d5f1

View File

@ -3760,29 +3760,38 @@ var
Info: PWinWidgetInfo;
{$ENDIF}
begin
if Widget = nil then Exit;
{$IFDEF Gtk1}
MainWidget := Widget;
if MainWidget = nil then Exit;
if GtkWidgetIsA(Widget,GTK_MENU_ITEM_GET_TYPE) then exit;
if GtkWidgetIsA(Widget, GTK_MENU_ITEM_GET_TYPE) then Exit;
ClientWidget:=GetFixedWidget(MainWidget);
WinWidgetInfo:=GetWidgetInfo(MainWidget,false);
if WinWidgetInfo<>nil then
ImplWidget:=WinWidgetInfo^.CoreWidget
ClientWidget := GetFixedWidget(MainWidget);
WinWidgetInfo := GetWidgetInfo(MainWidget, False);
if WinWidgetInfo <> nil then
ImplWidget := WinWidgetInfo^.CoreWidget
else
ImplWidget:=nil;
ImplWidget := nil;
if MainWidget = PGtkWidget(LastWFPResult) then
DestroyWindowFromPointCB(MainWidget, nil);
g_signal_handlers_destroy(PGtkObject(MainWidget));
if (ClientWidget<>nil) and (ClientWidget<>MainWidget) then
if (ClientWidget <> nil) and (ClientWidget <> MainWidget) then
begin
if ClientWidget = PGtkWidget(LastWFPResult) then
DestroyWindowFromPointCB(ClientWidget, nil);
g_signal_handlers_destroy(PGtkObject(ClientWidget));
if (ImplWidget<>nil)
and (ImplWidget<>ClientWidget) and (ImplWidget<>MainWidget) then
g_signal_handlers_destroy(PGtkObject(ImplWidget));
{$ELSE}
if Widget=nil then exit;
Info:=GetWidgetInfo(Widget,false);
if Info<>nil then begin
g_signal_handlers_disconnect_matched(Widget,G_SIGNAL_MATCH_DATA,0,0,nil,nil,Info);
end;
if (ImplWidget <> nil) and
(ImplWidget <> ClientWidget) and
(ImplWidget <> MainWidget) then
begin
if ImplWidget = PGtkWidget(LastWFPResult) then
DestroyWindowFromPointCB(ImplWidget, nil);
g_signal_handlers_destroy(PGtkObject(ImplWidget));
end;
{$ELSE}
Info := GetWidgetInfo(Widget, False);
if Info <> nil then
g_signal_handlers_disconnect_matched(Widget, G_SIGNAL_MATCH_DATA, 0, 0, nil, nil, Info);
{$ENDIF}
end;