1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-22 01:02:17 -05:00

Memory leak fix in ToTBitmap. If you use .SetSize and then .LoadFromRawImage,

the previously allocated data is not freed.



git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@359 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
Wizzup? 2010-01-02 13:02:57 +00:00
parent f45746a754
commit 2dc2725364
5 changed files with 382 additions and 333 deletions

File diff suppressed because it is too large Load Diff

View File

@ -110,7 +110,8 @@ begin
// more detailed info
writeln('EXCEPTION IN UPDATEFORM: We either hit Cancel, or something went wrong with files');
end;
Self.UpdateLog.Lines.Add('Done ...');
Self.UpdateLog.Lines.Add('Done ... ');
Self.UpdateLog.Lines.Add('Please restart all currently running Simba binaries.');
end;
initialization

View File

@ -186,6 +186,7 @@ begin
{ Copy the client to ImageMain }
bmp:=TMufasaBitmap.Create;
bmp.CopyClientToBitmap(Window, true, 0, 0, w-1, h-1);
ImageMain.Picture.Bitmap.Free;
ImageMain.Picture.Bitmap := bmp.ToTBitmap;
bmp.Free;

View File

@ -194,13 +194,13 @@ begin
begin
writeln('ReplacementFile not found');
exit(False);
raise Exception.Create('ReplacementFile not found');
//raise Exception.Create('ReplacementFile not found');
end;
if not FileExists(FReplacementFile+ '_') then
begin
writeln('ReplacementFile + _ not found');
exit(False);
raise Exception.Create('ReplacementFile + _ not found');
//raise Exception.Create('ReplacementFile + _ not found');
end;
RenameFile(FReplacementFile, FReplacementFile+'_old_');
RenameFile(FReplacementFile+'_', FReplacementFile);

View File

@ -395,7 +395,6 @@ var
begin
Result := TBitmap.Create;
Result.SetSize(self.Width, self.Height);
ArrDataToRawImage(Self.Fdata, point(self.width,self.height), tr);
Result.LoadFromRawImage(tr, false);
end;