diff --git a/src/plug-in/pluginmanager.cpp b/src/plug-in/pluginmanager.cpp index 6012a59bde292396b2f70fdce8d0a1d458ef8aa7..df88799a80d8f98a0af1290e03de65cdf759314d 100644 --- a/src/plug-in/pluginmanager.cpp +++ b/src/plug-in/pluginmanager.cpp @@ -13,6 +13,15 @@ _instance = 0; } +::sflphone::PluginManager* ::sflphone::PluginManager::instance() +{ + if(! _instance ){ + _instance = new PluginManager(); + } + return _instance; +} + + int ::sflphone::PluginManager::loadPlugins( const std::string &path ) { std::string pluginDir, current; diff --git a/src/plug-in/pluginmanager.h b/src/plug-in/pluginmanager.h index 651a0902f8e0db872052a2b0c234c66866ee92f1..78d988cd0c9f51df87d19b5fd9b33822c3118fe1 100644 --- a/src/plug-in/pluginmanager.h +++ b/src/plug-in/pluginmanager.h @@ -17,11 +17,6 @@ namespace sflphone { class PluginManager { public: - /** - * Default constructor - */ - PluginManager(); - /** * Destructor */ @@ -47,6 +42,11 @@ namespace sflphone { Plugin* isPluginLoaded( const std::string &name ); private: + /** + * Default constructor + */ + PluginManager(); + /** * Load a unix dynamic/shared library * @param filename The path to the dynamic/shared library diff --git a/test/audiorecorderTest.cpp b/test/audiorecorderTest.cpp index 8a9327cb5bed953d6e73274616eaa1741a7d7c85..f766d4af1d082307a256fe08c6506806810d733a 100644 --- a/test/audiorecorderTest.cpp +++ b/test/audiorecorderTest.cpp @@ -43,12 +43,10 @@ void AudioRecorderTest::testRecordData(){ for (SFLDataFormat i = -32768; i < 32767; i++ ){ buf[0] = i; buf[1] = i; - recAudio.recData(buf,2); + _ar->recData(buf,2); } - recAudio.closeFile(); - - + _ar->closeFile(); } void AudioRecorderTest::tearDown(){ diff --git a/test/pluginmanagerTest.cpp b/test/pluginmanagerTest.cpp index b9a3d413a400d422a7510963d36124ba1d026e14..e5dfff8e1172c7d9afb18342983906c8d675008b 100644 --- a/test/pluginmanagerTest.cpp +++ b/test/pluginmanagerTest.cpp @@ -27,7 +27,7 @@ using std::endl; void PluginManagerTest::setUp(){ // Instanciate the plugin manager object - _pm = new ::sflphone::PluginManager(); + _pm = ::sflphone::PluginManager::instance(); } void PluginManagerTest::testLoadPluginDirectory(){