mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 20:28:19 +02:00
LCL-GTK3: Prevent crash when Open/SaveDialog is closed. Remove 'destroy' signal handler. Still no memory leaks.
This commit is contained in:
parent
776e1e91ad
commit
0d20c53cd4
@ -961,8 +961,8 @@ end;
|
||||
Params: widget: PGtkWidget; data: gPointer
|
||||
Result: GBoolean
|
||||
|
||||
This function is called, when a commondialog is destroyed
|
||||
-------------------------------------------------------------------------------}
|
||||
This function is called when a commondialog is destroyed (caused a crash, removed)
|
||||
-------------------------------------------------------------------------------
|
||||
function gtkDialogDestroyCB(widget: PGtkWidget; data: gPointer): GBoolean; cdecl;
|
||||
begin
|
||||
Result := True;
|
||||
@ -970,7 +970,7 @@ begin
|
||||
TCommonDialog(data).UserChoice := mrCancel;
|
||||
TCommonDialog(data).Close;
|
||||
end;
|
||||
|
||||
}
|
||||
{-------------------------------------------------------------------------------
|
||||
function GTKDialogKeyUpDownCB
|
||||
Params: Widget: PGtkWidget; Event : pgdkeventkey; Data: gPointer
|
||||
@ -1482,8 +1482,8 @@ end;
|
||||
class procedure TGtk3WSCommonDialog.SetCallbacks(const AGtkWidget: PGtkWidget;
|
||||
const AWidgetInfo: TGtk3Dialog);
|
||||
begin
|
||||
g_signal_connect_data(AGtkWidget,
|
||||
'destroy', TGCallback(@gtkDialogDestroyCB), AWidgetInfo, nil, 0);
|
||||
//g_signal_connect_data(AGtkWidget,
|
||||
// 'destroy', TGCallback(@gtkDialogDestroyCB), AWidgetInfo, nil, 0);
|
||||
g_signal_connect_data(AGtkWidget,
|
||||
'delete-event', TGCallback(@gtkDialogCloseQueryCB), AWidgetInfo, nil, 0);
|
||||
g_signal_connect_data(AGtkWidget,
|
||||
|
Loading…
Reference in New Issue
Block a user