View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0038039 | Patches | LCL | public | 2020-11-05 01:03 | 2021-01-17 08:49 |
Reporter | Cyrax | Assigned To | Juha Manninen | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | Linux x86_64 | OS | Arch | ||
Product Version | 2.1 (SVN) | ||||
Summary | 0038039: TApplication class in LCL uses old way to register ExitProc and the procedure which does clean up, do not restore old ExitProc. | ||||
Description | See summary. TApplication.Destroy is too late for restoring old ExitProc handler. Attached patch will fix this bug. | ||||
Tags | No tags attached. | ||||
Fixed in Revision | r64110 | ||||
LazTarget | - | ||||
Widgetset | GTK 2 | ||||
Attached Files |
|
related to | 0038346 | resolved | Juha Manninen | Lazarus | Finalization causes sigabrt and hangs app |
|
fix-exitproc-chain.diff (941 bytes)
diff --git a/lcl/forms.pp b/lcl/forms.pp index e065cef415..817ae9d17c 100644 --- a/lcl/forms.pp +++ b/lcl/forms.pp @@ -1397,7 +1397,6 @@ type FMouseControl: TControl; FNavigation: TApplicationNavigationOptions; FOldExceptProc: TExceptProc; - FOldExitProc: Pointer; FOnActionExecute: TActionEvent; FOnActionUpdate: TActionEvent; FOnActivate: TNotifyEvent; diff --git a/lcl/include/application.inc b/lcl/include/application.inc index 66279d346c..18ff38c855 100644 --- a/lcl/include/application.inc +++ b/lcl/include/application.inc @@ -119,8 +119,7 @@ begin inherited Create(AOwner); CaptureExceptions:=true; - FOldExitProc:=ExitProc; - ExitProc:=@BeforeFinalization; + AddExitProc(@BeforeFinalization); OnGetApplicationName := @GetApplicationName; end; @@ -135,8 +134,6 @@ begin if Assigned(FOnDestroy) then FOnDestroy(Self); - ExitProc:=FOldExitProc; - ProcessAsyncCallQueue; |
|
Unless I am blind, you specify the GTK2 as the widget but the changes you are making effects all which is the LCL. Is the GTK2 getting effected by this ? I know the report marks the LCL but you also only indicated one Widget instead of all of them.. Can you reproduce an error that is worthy of this change because this is the existing point of the app and I really can't see how and why this would make a difference ? |
|
Please see this change at FPC trunk sources : https://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/rtl/inc/thread.inc?r1=47311&r2=47310&pathrev=47311 If the ExitProc call chain isn't restored properly, there is a memory leak in FPC RTL. EDIT : It is for all supported widgeset, I chose the GTK2 by habit. |
|
Applied, thanks. |
|
Cyrax, the related issue reports a problem in FPC trunk. Can you please look at it. |
|
Resolving and closing again. |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-11-05 01:03 | Cyrax | New Issue | |
2020-11-05 01:03 | Cyrax | File Added: fix-exitproc-chain.diff | |
2020-11-05 01:16 | jamie philbrook | Note Added: 0126744 | |
2020-11-05 01:22 | Cyrax | Note Added: 0126745 | |
2020-11-05 01:23 | Cyrax | Note Edited: 0126745 | View Revisions |
2020-11-05 01:24 | Cyrax | Note Edited: 0126745 | View Revisions |
2020-11-06 11:08 | Juha Manninen | Assigned To | => Juha Manninen |
2020-11-06 11:08 | Juha Manninen | Status | new => assigned |
2020-11-06 11:43 | Juha Manninen | Status | assigned => resolved |
2020-11-06 11:43 | Juha Manninen | Resolution | open => fixed |
2020-11-06 11:43 | Juha Manninen | Fixed in Revision | => r64110 |
2020-11-06 11:43 | Juha Manninen | LazTarget | => - |
2020-11-06 11:43 | Juha Manninen | Widgetset | GTK 2 => GTK 2 |
2020-11-06 11:43 | Juha Manninen | Note Added: 0126769 | |
2020-11-07 16:20 | Cyrax | Status | resolved => closed |
2021-01-11 18:16 | Juha Manninen | Relationship added | related to 0038346 |
2021-01-15 20:02 | Juha Manninen | Status | closed => assigned |
2021-01-15 20:02 | Juha Manninen | Resolution | fixed => open |
2021-01-15 20:02 | Juha Manninen | Note Added: 0128364 | |
2021-01-17 08:49 | Juha Manninen | Status | assigned => resolved |
2021-01-17 08:49 | Juha Manninen | Resolution | open => fixed |
2021-01-17 08:49 | Juha Manninen | Widgetset | GTK 2 => GTK 2 |
2021-01-17 08:49 | Juha Manninen | Note Added: 0128386 | |
2021-01-17 08:49 | Juha Manninen | Status | resolved => closed |