Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
Delphi-BCB
RTL
Delphi
Arithmetic
ConvUtils
Date - Time
DateUtils
File Management
Format + Float
Input/Output
Math Unit
Memory, Pointer, Address
Null-terminated strings
Other Classes
Other RTL
Pascal Strings
Regular Expressions
RTL Exceptions
Text Files
Thread support
Typed/Untyped Files
WinAPI
You are not logged in.
Help
Print
Public Report
Report From:
Delphi-BCB/RTL/Delphi/Thread support
[ Add a report in this area ]
Report #:
95531
Status:
Open
CheckSynchronize leaks when queued method raises exception
Project:
Delphi
Build #:
14.0.3593.2582
Version:
14.0
Submitted By:
David Heffernan
Report Type:
Basic functionality failure
Date Reported:
6/23/2011 9:01:14 AM
Severity:
Commonly encountered problem
Last Updated:
3/20/2012 2:24:39 AM
Platform:
All platforms
Internal Tracking #:
284121
Resolution:
None
(Resolution Comments)
Resolved in Build:
:
None
Duplicate of:
None
Voting and Rating
Overall Rating:
No Ratings Yet
0.00 out of 5
Total Votes:
None
Description
CheckSynchronize leaks when queued method raises exception
Steps to Reproduce:
Here is an extract from CheckSynchronize.
while LocalSyncList.Count > 0 do
begin
SyncProc := LocalSyncList[0];
LocalSyncList.Delete(0);
LeaveCriticalSection(ThreadLock);
try
try
if Assigned(SyncProc.SyncRec.FMethod) then
SyncProc.SyncRec.FMethod()
else if Assigned(SyncProc.SyncRec.FProcedure) then
SyncProc.SyncRec.FProcedure();
except
if not SyncProc.Queued then
SyncProc.SyncRec.FSynchronizeException := AcquireExceptionObject
else
raise;
end;
finally
EnterCriticalSection(ThreadLock);
end;
if not SyncProc.Queued then
{$IFDEF MSWINDOWS}
SetEvent(SyncProc.Signal)
{$ENDIF}
{$IFDEF LINUX}
pthread_cond_signal(SyncProc.Signal)
{$ENDIF}
else
begin
Dispose(SyncProc.SyncRec);
Dispose(SyncProc);
end;
end;
The problem occurs when a queued method raises an exception. In this situation the two Dispose calls at the bottom of the excerpt do not run and the memory is thus leaked. Perhaps this is by design but if so then the documentation of TThread.Queue is deficient.
Workarounds
None
Attachment
None
Comments
None
View Your Reports
Search
Server Response from: ETNACODE01
Developer Tools
Blackfish SQL
C++Builder
Delphi
FireMonkey
Prism
InterBase
JBuilder
J Optimizer
HTML5 Builder
3rdRail & TurboRuby
Database Tools
Change Manager
DBArtisan
DB Optimizer
ER/Studio
Performance Center
Rapid SQL
Technical Articles
Tutorials
White Papers
Press Releases
Newsletters
Add Content (GetPublished)
Audio
Audio & Video
Video
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Tags
Technology Partners
Downloads
Free Trials
Registered User Downloads
Beta Programs
Add Content (GetPublished)
Articles
Blogs
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Member Services
About
Connect with Us