summaryrefslogtreecommitdiff
path: root/synth/programs.cpp
diff options
context:
space:
mode:
authorFlorian Jung <flo@thinkpad.(none)>2011-01-11 16:46:38 +0100
committerFlorian Jung <flo@thinkpad.(none)>2011-01-11 16:57:57 +0100
commit8201450efc105691e343c50b4eab946f7b0ee038 (patch)
tree70c0dd8c26740db888a7e7d096a6be7b1ed85353 /synth/programs.cpp
parentdb04e2fb861ed7ccef5a7339e9860ca5c2590a7c (diff)
Now keeping track of unused shared objects and maybe unloading them
Diffstat (limited to 'synth/programs.cpp')
-rw-r--r--synth/programs.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/synth/programs.cpp b/synth/programs.cpp
index 094f209..b896a06 100644
--- a/synth/programs.cpp
+++ b/synth/programs.cpp
@@ -1,8 +1,10 @@
#include <string>
#include <cstring>
+#include <dlfcn.h>
#include "programs.h"
#include "globals.h"
+#include "shared_object_manager.h"
using namespace std;
@@ -78,6 +80,12 @@ void program_t::cleanup()
delete [] pfactor.fm[i];
delete [] pfactor.fm;
}
+
+ if (dl_handle)
+ dlref_dec(dl_handle);
+
+ dl_handle=NULL;
+ create_func=NULL;
}
program_t& program_t::operator=(const program_t &that)
@@ -121,6 +129,8 @@ program_t& program_t::operator=(const program_t &that)
this->create_func=that.create_func;
this->dl_handle=that.dl_handle;
+ if (dl_handle)
+ dlref_inc(dl_handle);
return *this;
}