mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 16:31:40 +02:00
win32 interface: fixed memleak when showing an open file dialog
git-svn-id: trunk@11058 -
This commit is contained in:
parent
5c4e0e65c5
commit
bfe4a7f795
@ -482,15 +482,16 @@ end;
|
||||
|
||||
class procedure TWin32WSSaveDialog.DestroyHandle(const ACommonDialog: TCommonDialog);
|
||||
var
|
||||
OPENFILE: LPOPENFILENAME;
|
||||
OpenFile: LPOPENFILENAME;
|
||||
begin
|
||||
if ACommonDialog.Handle <> 0 then
|
||||
begin
|
||||
OPENFILE := LPOPENFILENAME(ACommonDialog.Handle);
|
||||
if OPENFILE^.lCustData <> 0 then
|
||||
OpenFile := LPOPENFILENAME(ACommonDialog.Handle);
|
||||
if OpenFile^.lCustData <> 0 then
|
||||
Dispose(POpenFileDialogRec(OPENFILE^.lCustData));
|
||||
StrDispose(OpenFile^.lpStrFilter);
|
||||
FreeMem(OpenFile^.lpStrFile);
|
||||
FreeMem(OpenFile);
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -519,6 +520,7 @@ begin
|
||||
Dispose(POpenFileDialogRec(OPENFILE^.lCustData));
|
||||
StrDispose(OpenFile^.lpStrFilter);
|
||||
FreeMem(OpenFile^.lpStrFile);
|
||||
FreeMem(OpenFile);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user