From 624d25b8c3e9bd1648fdadbe28e1859cecab494f Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 22 May 2016 16:44:11 +0200 Subject: Explicitly stop the loader thread to ensure we don't delete the DrumGizmo::drumkit member while the loader is attached to it. --- src/drumkitloader.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/drumkitloader.h') diff --git a/src/drumkitloader.h b/src/drumkitloader.h index cca11af..9608e14 100644 --- a/src/drumkitloader.h +++ b/src/drumkitloader.h @@ -49,15 +49,18 @@ class DrumKitLoader : public Thread { public: - //! The constrcutor starts the loader thread. DrumKitLoader(Settings& settings, DrumKit& kit, AudioInputEngine& ie, Resamplers& resamplers, Random& rand); - //! The destructor signals the thread to stop and waits to merge before - //! returning (ie. deleting the object will garantuee that the thread has - //! been stopped). ~DrumKitLoader(); + //! Starts the loader thread. + void init(); + + //! Signal the loader thread to stop and waits for the threads to merge + //! before returning. + void deinit(); + bool loadkit(const std::string& file); //! Signal the loader to start loading all audio files contained in the kit. @@ -65,9 +68,6 @@ public: //! scheduled. void loadKit(DrumKit *kit); - //! Signal the loader to stop and wait until it has. - void stop(); - //! Skip all queued AudioFiles. void skip(); -- cgit v1.2.3