From fdebc6367f9806c7ed68e8ad0df54de08cae7104 Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Thu, 12 Jan 2023 23:33:25 +0100 Subject: [PATCH] Reduce scope of _extScrollView _intScrollView from ivar to local variables, release after setting to content view and fix double-release of _intScrollView. --- ChangeLog | 8 ++++++++ Modules/Editors/ProjectCenter/PCEditor.h | 2 -- Modules/Editors/ProjectCenter/PCEditor.m | 5 ++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index a733d9b..d7d7d83 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2022-01-12 Riccardo Mottola + + * Modules/Editors/ProjectCenter/PCEditor.h + * Modules/Editors/ProjectCenter/PCEditor.m + Reduce scope of _extScrollView _intScrollView from ivar to local + variables, release after setting to content view and fix + double-release of _intScrollView. + 2021-11-30 Riccardo Mottola * Modules/Editors/ProjectCenter/PCEditorView.h diff --git a/Modules/Editors/ProjectCenter/PCEditor.h b/Modules/Editors/ProjectCenter/PCEditor.h index 02620e8..5c9790d 100644 --- a/Modules/Editors/ProjectCenter/PCEditor.h +++ b/Modules/Editors/ProjectCenter/PCEditor.h @@ -38,10 +38,8 @@ id _editorManager; NSTextField *_extStatusField; - NSScrollView *_extScrollView; PCEditorView *_extEditorView; NSTextField *_intStatusField; - NSScrollView *_intScrollView; PCEditorView *_intEditorView; NSTextStorage *_storage; NSMutableString *_path; diff --git a/Modules/Editors/ProjectCenter/PCEditor.m b/Modules/Editors/ProjectCenter/PCEditor.m index 2f49195..ac46ea2 100644 --- a/Modules/Editors/ProjectCenter/PCEditor.m +++ b/Modules/Editors/ProjectCenter/PCEditor.m @@ -41,6 +41,7 @@ - (void)_createWindow { + NSScrollView *_extScrollView; unsigned int style; NSRect winContentRect; NSRect rect; @@ -110,6 +111,7 @@ - (void)_createInternalView { + NSScrollView *_intScrollView; NSRect contRect = NSMakeRect(0,0,512,320); NSRect rect; @@ -235,9 +237,7 @@ { if ((self = [super init])) { - _extScrollView = nil; _extEditorView = nil; - _intScrollView = nil; _intEditorView = nil; _storage = nil; _categoryPath = nil; @@ -281,7 +281,6 @@ // _window is setReleasedWhenClosed:YES RELEASE(_path); RELEASE(_categoryPath); - RELEASE(_intScrollView); RELEASE(_storage); RELEASE(_window);