Fixed activeEditor wild pointer issue when destroying plug-in window in AudioPluginHost#1619
Closed
Sqazine wants to merge 1 commit into
Closed
Fixed activeEditor wild pointer issue when destroying plug-in window in AudioPluginHost#1619Sqazine wants to merge 1 commit into
Sqazine wants to merge 1 commit into
Conversation
…in AudioPluginHost
Member
|
Thanks for reporting! This issue has been fixed on the develop branch: |
Author
|
Great! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:

Close the plugin window and reopen:
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:
And the activeEditor member seens invalid.
activeEditor is a raw pointer member of AudioProcessor class.
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:
And in AudioProcessor::createEditorIfNeeded(),it always a pretty null pointer
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.