mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 17:50:19 +02:00
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:
parent
273106521a
commit
d43964d5f1
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user