set was_activated to false when deactivate() is run and clean up the
authorSampo Savolainen <v2@iki.fi>
Tue, 25 Sep 2007 17:54:23 +0000 (17:54 +0000)
committerSampo Savolainen <v2@iki.fi>
Tue, 25 Sep 2007 17:54:23 +0000 (17:54 +0000)
cleanup() method

git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2484 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/ardour/ladspa_plugin.h

index b7cca2270d3d6c04d1bae83c54d4ddc828338ffd..81936ab3d3c10f17c726a8e408e6fd3c407c33e1 100644 (file)
@@ -71,17 +71,23 @@ class LadspaPlugin : public ARDOUR::Plugin
                if (descriptor->activate) {
                        descriptor->activate (handle);
                }
+
                was_activated = true;
        }
        void deactivate () {
                if (!was_activated)
                        return;
 
-               if (descriptor->deactivate) 
+               if (descriptor->deactivate) {
                        descriptor->deactivate (handle);
+               }
+       
+               was_activated = false;
        }
        void cleanup () {
-               if (was_activated && descriptor->cleanup) {
+               deactivate();
+
+               if (descriptor->cleanup) {
                        descriptor->cleanup (handle);
                }
        }