Skip to content

Fixed activeEditor wild pointer issue when destroying plug-in window in AudioPluginHost#1619

Closed
Sqazine wants to merge 1 commit into
juce-framework:developfrom
Sqazine:develop
Closed

Fixed activeEditor wild pointer issue when destroying plug-in window in AudioPluginHost#1619
Sqazine wants to merge 1 commit into
juce-framework:developfrom
Sqazine:develop

Conversation

@Sqazine
Copy link
Copy Markdown

@Sqazine Sqazine commented Jan 29, 2026

Problem description:

When I debugged my plug-in on 8.0.12 version, I found that the plug-in window opened normally the first time, but only a default window opened the second time.At first I thought there was something wrong with my plug-in code.So i debug AudioPluginHost's internal plugin,and found the same situation.

First Open:
image

Close the plugin window and reopen:

image

This happens with all plugins that have an editor.Not a specific one.

Problem analysis:

So i debug AudioPluginHost project.When I open the plugin window the second time, this place will report an error:

Snipaste_2026-01-29_17-17-18

And the activeEditor member seens invalid.

image

activeEditor is a raw pointer member of AudioProcessor class.

image

So i debug 7.0.12 version,no matter how many times I open the plug-in window, it always displays correctly.And the activeEditor member is a safe pointer:

image

And in AudioProcessor::createEditorIfNeeded(),it always a pretty null pointer

image

So i think in version 8.0.12, the object pointed to by the activeEditor pointer has been destroyed, but the activeEditor is not set to null, resulting in a wild pointer.

My solution

So I use the editorBeingDeleted() function, with AudioProcessor's own editor as an argument, to set the AudioProcessor's activeEditor member to null before deleting the plug-in editor.As below.

@reuk
Copy link
Copy Markdown
Member

reuk commented Jan 30, 2026

Thanks for reporting! This issue has been fixed on the develop branch:

8840ac4

@reuk reuk closed this Jan 30, 2026
@Sqazine
Copy link
Copy Markdown
Author

Sqazine commented Jan 30, 2026

Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants