mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-10 09:28:21 +02:00
fixed freeing TReader.Driver
git-svn-id: trunk@5788 -
This commit is contained in:
parent
a6d5670154
commit
32db79433f
@ -1542,7 +1542,8 @@ initialization
|
||||
{$IFDEF UseFCLDataModule}
|
||||
RegisterInitComponentHandler(TComponent,@InitResourceComponent);
|
||||
{$ENDIF}
|
||||
// keep this comment, there is parser a bug in fpc 1.0.x
|
||||
|
||||
// keep this comment line, there is parser a bug in fpc 1.0.x
|
||||
|
||||
finalization
|
||||
//DebugLn('forms.pp - finalization section');
|
||||
|
@ -178,7 +178,7 @@ var
|
||||
LRSObjectWriterClass: TLRSObjectWriterClass;
|
||||
|
||||
function InitLazResourceComponent(Instance: TComponent;
|
||||
RootAncestor: TClass): Boolean;
|
||||
RootAncestor: TClass): Boolean;
|
||||
function CreateLRSReader(s: TStream; var DestroyDriver: boolean): TReader;
|
||||
function CreateLRSWriter(s: TStream; var DestroyDriver: boolean): TWriter;
|
||||
|
||||
@ -1642,7 +1642,7 @@ begin
|
||||
{$IFDEF NewLRSStreamer}
|
||||
if Result.Driver.ClassType=LRSObjectReaderClass then exit;
|
||||
// hack to set a write protected variable.
|
||||
DestroyDriver:=true;
|
||||
// DestroyDriver:=true; TReader will free it
|
||||
Driver:=LRSObjectReaderClass.Create(s,4096);
|
||||
p:=@Result.Driver;
|
||||
Result.Driver.Free;
|
||||
|
Loading…
Reference in New Issue
Block a user