# AudioProcessorEditor constructor is called two times

**URL:** <https://forum.juce.com/t/audioprocessoreditor-constructor-is-called-two-times/44331>\
**Category:** General JUCE discussion\
**Created:** [February 8, 2021, 5:22pm UTC](https://forum.juce.com/t/audioprocessoreditor-constructor-is-called-two-times/44331 "2021-02-08T17:22:19Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![stephenk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/stephenk/32/15198_2.png) [@stephenk](https://forum.juce.com/u/stephenk)\
**Post date:** [February 10, 2021, 3:57pm UTC](https://forum.juce.com/t/audioprocessoreditor-constructor-is-called-two-times/44331/10 "2021-02-10T15:57:14Z")

</div>

A “search” can be your friend: 😉

> [@PluginProcessor constructor is called twice by audio plugin host](https://forum.juce.com/t/pluginprocessor-constructor-is-called-twice-by-audio-plugin-host/26584/9):
>
> Don’t actually do anything time consuming in the constructor. (Start doing it later instead.) It can easily happen that the host constructs the plugin, immediately destroys it and then constructs it again. Also, if there are multiple instances of the plugin in the host project, the host of course calls the constructor for each instance separately.

> [@When (and how often) is the AudioProcessorEditor constructor called?](https://forum.juce.com/t/when-and-how-often-is-the-audioprocessoreditor-constructor-called/27973):
>
> Is the AudioProcessorEditor constructor called just once (or twice, as I’ve read), when the host loads the plugin for the first time, or is it called every time you open the (already loaded) plugin’s GUI? Thanks slight_smile

> [@PluginEditor construction happens twice](https://forum.juce.com/t/plugineditor-construction-happens-twice/19598/7):
>
> Don’t mean to resurrect an old thread, but I’ve noticed this issue a few times and was always curious as to why it happened. The issue it caused for me was, when displaying a nag screen in the constructor of the pluginEditor, the user would have to dismiss it twice, as the constructor is called twice. Any good work arounds for this? I want it to be a nag screen to purchase, but I don’t want them to have to click twice.

…there are more.

---

_[View the full topic](https://forum.juce.com/t/audioprocessoreditor-constructor-is-called-two-times/44331)._
