]> sigrok.org Git - libsigrokflow.git/commitdiff
Srf::deinit(): Add initial implementation.
authorUwe Hermann <redacted>
Tue, 8 Jan 2019 22:27:41 +0000 (23:27 +0100)
committerUwe Hermann <redacted>
Tue, 8 Jan 2019 23:57:10 +0000 (00:57 +0100)
include/libsigrokflow/libsigrokflow.hpp
src/main.cpp

index c13e1c65203b96215e0a7c5c14ad740eff575311..944c99c6fe94849324f91948d6d1db7d193f6559 100644 (file)
@@ -42,6 +42,8 @@ using namespace std;
 
 void init();
 
+void deinit();
+
 class Block
 {
         /* Config API etc goes here */
index 45d2308fe3a99387229095d4d1aaf84f7325aee1..8f9531730013829c91828f66992d5a829c3f5f87 100644 (file)
@@ -28,11 +28,11 @@ namespace Srf
 using namespace std;
 using namespace std::placeholders;
 
+static bool srf_initialized_ = false;
+
 void init()
 {
-       static bool srf_initialized = false;
-
-       if (srf_initialized)
+       if (srf_initialized_)
                throw runtime_error("libsigrokflow is already initialized");
 
 #ifdef HAVE_LIBSIGROKCXX
@@ -60,7 +60,12 @@ void init()
                        "0.01", "GPL", "sigrok", "libsigrokflow", "http://sigrok.org");
 #endif
 
-       srf_initialized = true;
+       srf_initialized_ = true;
+}
+
+void deinit()
+{
+       srf_initialized_ = false;
 }
 
 Sink::Sink(GstBaseSink *gobj) :