Skip to content

Commit

Permalink
unset OnDebugLn when destroying
Browse files Browse the repository at this point in the history
  • Loading branch information
ollydev committed Jan 14, 2024
1 parent b9feea5 commit 5ddcb78
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 0 additions & 6 deletions Source/forms/simba.main.pas
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ TSimbaForm = class(TForm)
procedure MenuItemACAClick(Sender: TObject);
procedure MenuItemAssociateScriptsClick(Sender: TObject);
procedure MenuItemImageToStringClick(Sender: TObject);
procedure MenuItemConsoleClick(Sender: TObject);
procedure MenuItemDocumentationClick(Sender: TObject);
procedure MenuItemDTMEditorClick(Sender: TObject);
procedure MenuItemFindNextClick(Sender: TObject);
Expand Down Expand Up @@ -944,11 +943,6 @@ procedure TSimbaForm.MenuItemResetLayoutClick(Sender: TObject);
QueueOnMainThread(@DoResetDocking);
end;

procedure TSimbaForm.MenuItemConsoleClick(Sender: TObject);
begin
SimbaSettings.General.ConsoleVisible.Value := TMenuItem(Sender).Checked;
end;

procedure TSimbaForm.MenuItemLockLayoutClick(Sender: TObject);
begin
SimbaSettings.General.LockLayout.Value := TMenuItem(Sender).Checked;
Expand Down
8 changes: 8 additions & 0 deletions Source/forms/simba.outputform.pas
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ TSimbaOutputForm = class(TForm)
function GetActiveOutputBox: TSimbaOutputBox;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;

property SimbaOutputBox: TSimbaOutputBox read FSimbaOutputBox;
property ActiveOutputBox: TSimbaOutputBox read GetActiveOutputBox;
Expand Down Expand Up @@ -636,5 +637,12 @@ constructor TSimbaOutputForm.Create(AOwner: TComponent);
SimbaIDEEvents.Register(Self, SimbaIDEEvent.TAB_CHANGE, @DoScriptTabChange);
end;

destructor TSimbaOutputForm.Destroy;
begin
OnDebugLn := nil;

inherited Destroy();
end;

end.

4 changes: 1 addition & 3 deletions Source/simba.settings.pas
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ TSimbaSettings = class
FIsLoading: Boolean;
public
General: record
ConsoleVisible: TSimbaSetting;
TrayIconVisible: TSimbaSetting;
Layout: TSimbaSetting;
LockLayout: TSimbaSetting;
Expand Down Expand Up @@ -318,7 +317,7 @@ procedure TSimbaSetting.Changed;
if FSettings.IsLoading then
Exit;

DebugLn('[TSimbaSettings] Setting changed: ' + FName);
// DebugLn('[TSimbaSettings] Setting changed: ' + FName);

I := FChangeEventList.Count;
while FChangeEventList.NextDownIndex(I) do
Expand Down Expand Up @@ -477,7 +476,6 @@ constructor TSimbaSettings.Create;
FList := TSettingList.Create();

// General
General.ConsoleVisible := TSimbaSetting_Boolean.Create(Self, 'General', 'ConsoleVisible', True);
General.TrayIconVisible := TSimbaSetting_Boolean.Create(Self, 'General', 'TrayIconVisible', True);
General.LockLayout := TSimbaSetting_Boolean.Create(Self, 'General', 'LockLayout', False);
General.Layout := TSimbaSetting_BinaryString.Create(Self, 'General', 'Layout', '');
Expand Down

0 comments on commit 5ddcb78

Please sign in to comment.