Commit 88c73791 authored by Emmanuel Milou's avatar Emmanuel Milou

Complete singleton pattern for the plugin manager

parent 2fdc5057
......@@ -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;
......
......@@ -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
......
......@@ -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(){
......
......@@ -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(){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment