# AudioPluginHost Bug: Duplicate Instance on Drag & Drop

**URL:** <https://forum.juce.com/t/audiopluginhost-bug-duplicate-instance-on-drag-drop/47794>\
**Category:** General JUCE discussion\
**Created:** [September 12, 2021, 11:37pm UTC](https://forum.juce.com/t/audiopluginhost-bug-duplicate-instance-on-drag-drop/47794 "2021-09-12T23:37:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rollo](https://avatars.discourse-cdn.com/v4/letter/r/e9bcb4/32.png) [@rollo](https://forum.juce.com/u/rollo)\
**Post date:** [September 12, 2021, 11:37pm UTC](https://forum.juce.com/t/audiopluginhost-bug-duplicate-instance-on-drag-drop/47794/1 "2021-09-12T23:37:26Z")

</div>

Hi all,  
I just spent the better part of my evening hunting down a problem and just wanted drop a note here in case anyone experiences the same problems.

TL;DR If you get duplicate instances in the AudioPluginHost, clear the plugin list.

* * *

Whenever I was dragging the built .vst3 onto the AudioPluginHost to create another instance the following happened: The first instance behaved as expected. The second time however there were two instances right on top of each other, only noticeable because of the darker drop shadow.  
While debugging I also found out that the constructor of AudioProcessor was called more often than usual.

I then went spent quite some time thinking I managed to introduce a very weird bug. Cleaning the build folder multiple times. When I didn’t find anything I decided to create a new project and then copy my code into it, after a while I had two identical projects, where the one would produce a vst3 that resulted in duplicated instances and the other one working fine.  
I even copied the “faulty” plugin code into the other folder, with the same behaviour.

At one point I tried to rename my original folder and it worked fine. When changing it back to the old name I got duplicates again.

Long story short, when I cleared the plugin list in the AudioPluginHost everything was working fine again.

rollo
