From fdc3df9c3bf18e5c30ca34b89ad05028203d592a Mon Sep 17 00:00:00 2001 From: Raymond Date: Thu, 25 Mar 2010 16:09:38 +0100 Subject: [PATCH 1/3] Free manager earlier. --- Projects/SAMufasaGUI/testunit.pas | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Projects/SAMufasaGUI/testunit.pas b/Projects/SAMufasaGUI/testunit.pas index 1c7b980..9a86611 100644 --- a/Projects/SAMufasaGUI/testunit.pas +++ b/Projects/SAMufasaGUI/testunit.pas @@ -1683,8 +1683,9 @@ begin if not DeleteTab(i,true) then begin; CloseAction := caNone; - exit + exit; end; + FreeAndNil(ExtManager); end; procedure TForm1.FormCreate(Sender: TObject); @@ -1754,6 +1755,8 @@ begin TMufasaTab(Tabs[i]).Free; for i := 0 to high(RecentFileItems) do RecentFileItems[i].Free; + if ExtManager <> nil then + ExtManager.free; Tabs.free; Selector.Free; Picker.Free; @@ -1762,7 +1765,6 @@ begin SetLength(DebugStream, 0); RecentFiles.Free; DebugCriticalSection.Free; - ExtManager.free; {$ifdef MSWindows} if not UnRegisterHotkey(Self.Handle,0) then mDebugLn('Unable to unregister ctrl + alt + s as global hotkey'); From 43c859f317c8aec5905b3a1ec563bfcb44491e86 Mon Sep 17 00:00:00 2001 From: Raymond Date: Thu, 25 Mar 2010 16:21:21 +0100 Subject: [PATCH 2/3] Fixed some constrcutors (forgot to Inherit Create) --- Units/MMLAddon/mmlpsthread.pas | 10 +++++----- Units/MMLAddon/settings.pas | 1 + Units/MMLAddon/settingssandbox.pas | 2 +- Units/MMLCore/os_windows.pas | 5 ++++- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Units/MMLAddon/mmlpsthread.pas b/Units/MMLAddon/mmlpsthread.pas index 943db2d..e3e6a9a 100644 --- a/Units/MMLAddon/mmlpsthread.pas +++ b/Units/MMLAddon/mmlpsthread.pas @@ -275,6 +275,7 @@ end; {***implementation TMThread***} constructor TMThread.Create(CreateSuspended: boolean; TheSyncInfo: PSyncInfo; plugin_dir: string); begin + inherited Create(CreateSuspended); Client := TClient.Create(plugin_dir); MInternet := TMInternet.Create(Client); SyncInfo:= TheSyncInfo; @@ -288,8 +289,6 @@ begin Sett := nil; Prop := TScriptProperties.Create; - - inherited Create(CreateSuspended); end; destructor TMThread.Destroy; @@ -298,7 +297,8 @@ begin Client.Free; Includes.free; Prop.Free; - Sett.Free; + if Sett <> nil then + Sett.Free; inherited Destroy; end; @@ -514,6 +514,7 @@ constructor TPSThread.Create(CreateSuspended : boolean; TheSyncInfo : PSyncInfo; var I : integer; begin + inherited Create(CreateSuspended, TheSyncInfo, plugin_dir); PSScript := TPSScript.Create(nil); PSScript.UsePreProcessor:= True; PSScript.OnNeedFile := @RequireFile; @@ -525,7 +526,6 @@ begin PSScript.OnFindUnknownFile:=@PSScriptFindUnknownFile; // Set some defines {$I PSInc/psdefines.inc} - inherited Create(CreateSuspended, TheSyncInfo, plugin_dir); for i := 0 to high(ExportedMethods) do if pos('Writeln',exportedmethods[i].FuncDecl) > 0 then begin @@ -806,10 +806,10 @@ constructor TCPThread.Create(CreateSuspended: Boolean; TheSyncInfo : PSyncInfo; var plugin_idx: integer; begin + inherited Create(CreateSuspended, TheSyncInfo, plugin_dir); if libcpascal = 0 then LoadCPascal(plugin_dir); instance:= interp_init(@Interpreter_Precompiler, @Interpreter_ErrorHandler); - inherited Create(CreateSuspended, TheSyncInfo, plugin_dir); end; destructor TCPThread.Destroy; diff --git a/Units/MMLAddon/settings.pas b/Units/MMLAddon/settings.pas index 3652fd1..95cf2b0 100644 --- a/Units/MMLAddon/settings.pas +++ b/Units/MMLAddon/settings.pas @@ -118,6 +118,7 @@ end; constructor TMMLSettings.Create(aNodes: TTreeNodes); begin + inherited Create; Self.Nodes := aNodes; end; diff --git a/Units/MMLAddon/settingssandbox.pas b/Units/MMLAddon/settingssandbox.pas index c87d842..6707569 100644 --- a/Units/MMLAddon/settingssandbox.pas +++ b/Units/MMLAddon/settingssandbox.pas @@ -53,6 +53,7 @@ implementation constructor TMMLSettingsSandbox.Create(sett: TMMLSettings); begin + inherited; Self.ST := sett; end; @@ -81,7 +82,6 @@ end; function TMMLSettingsSandbox.GetKeyValue(KeyName: String): String; begin - writeln('getkeyvalue'); exit(ST.GetKeyValue(Prefix + KeyName)) end; diff --git a/Units/MMLCore/os_windows.pas b/Units/MMLCore/os_windows.pas index f8a7801..a80f9ca 100644 --- a/Units/MMLCore/os_windows.pas +++ b/Units/MMLCore/os_windows.pas @@ -174,7 +174,10 @@ implementation constructor TWindow.Create(target: Hwnd); begin - self.create; //Call the other create + inherited Create; + self.buffer:= TBitmap.Create; + self.buffer.PixelFormat:= pf32bit; + keyinput:= TKeyInput.Create; self.handle:= target; self.dc:= GetWindowDC(target); end; From 74cbafb2a0b9e74ecd5418f5ea58638c96d20fa5 Mon Sep 17 00:00:00 2001 From: Raymond Date: Thu, 25 Mar 2010 17:50:52 +0100 Subject: [PATCH 3/3] crlf error.. I guess? --- Projects/SAMufasaGUI/debugimage.lrs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Projects/SAMufasaGUI/debugimage.lrs b/Projects/SAMufasaGUI/debugimage.lrs index fb31450..5a4a408 100644 --- a/Projects/SAMufasaGUI/debugimage.lrs +++ b/Projects/SAMufasaGUI/debugimage.lrs @@ -1,11 +1,11 @@ -{ This is an automatically generated lazarus resource file } - -LazarusResources.Add('TDebugImgForm','FORMDATA',[ - 'TPF0'#13'TDebugImgForm'#12'DebugImgForm'#4'Left'#3#235#1#6'Height'#3','#1#3 - +'Top'#3#10#1#5'Width'#3#144#1#11'BorderIcons'#11#12'biSystemMenu'#10'biMinim' - +'ize'#0#11'BorderStyle'#7#12'bsToolWindow'#7'Caption'#6#12'DebugImgForm'#12 - +'ClientHeight'#3','#1#11'ClientWidth'#3#144#1#8'OnCreate'#7#10'FormCreate'#6 - +'OnHide'#7#8'FormHide'#8'OnResize'#7#10'FormResize'#10'LCLVersion'#6#6'0.9.2' - +'9'#0#6'TImage'#9'DrawImage'#4'Left'#2#0#6'Height'#3','#1#3'Top'#2#0#5'Width' - +#3#144#1#5'Align'#7#8'alClient'#0#0#0 -]); \ No newline at end of file +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('TDebugImgForm','FORMDATA',[ + 'TPF0'#13'TDebugImgForm'#12'DebugImgForm'#4'Left'#3#235#1#6'Height'#3','#1#3 + +'Top'#3#10#1#5'Width'#3#144#1#11'BorderIcons'#11#12'biSystemMenu'#10'biMinim' + +'ize'#0#11'BorderStyle'#7#12'bsToolWindow'#7'Caption'#6#12'DebugImgForm'#12 + +'ClientHeight'#3','#1#11'ClientWidth'#3#144#1#8'OnCreate'#7#10'FormCreate'#6 + +'OnHide'#7#8'FormHide'#8'OnResize'#7#10'FormResize'#10'LCLVersion'#6#6'0.9.2' + +'9'#0#6'TImage'#9'DrawImage'#4'Left'#2#0#6'Height'#3','#1#3'Top'#2#0#5'Width' + +#3#144#1#5'Align'#7#8'alClient'#0#0#0 +]);