summaryrefslogtreecommitdiff
path: root/plugin.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-01-30 14:23:01 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2005-01-30 14:23:01 +0100
commit2bec1d5ca0aad0bc18d99ed33c1b1ce443abb699 (patch)
tree744c9c05dd6ed3922174a93ed515581e64bc4dfd /plugin.c
parenta430f64252f5b38bb19dc151c3793d66d64a8fb7 (diff)
downloadvdr-2bec1d5ca0aad0bc18d99ed33c1b1ce443abb699.tar.gz
vdr-2bec1d5ca0aad0bc18d99ed33c1b1ce443abb699.tar.bz2
Added cPlugin::Stop()
Diffstat (limited to 'plugin.c')
-rw-r--r--plugin.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/plugin.c b/plugin.c
index a06d003c..b7ebf372 100644
--- a/plugin.c
+++ b/plugin.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: plugin.c 1.12 2004/12/19 12:05:28 kls Exp $
+ * $Id: plugin.c 1.13 2005/01/30 14:05:20 kls Exp $
*/
#include "plugin.h"
@@ -28,6 +28,7 @@ char *cPlugin::configDirectory = NULL;
cPlugin::cPlugin(void)
{
name = NULL;
+ started = false;
}
cPlugin::~cPlugin()
@@ -60,6 +61,10 @@ bool cPlugin::Start(void)
return true;
}
+void cPlugin::Stop(void)
+{
+}
+
void cPlugin::Housekeeping(void)
{
}
@@ -322,6 +327,7 @@ bool cPluginManager::StartPlugins(void)
Setup.OSDLanguage = Language;
if (!p->Start())
return false;
+ p->started = true;
}
}
return true;
@@ -366,15 +372,25 @@ cPlugin *cPluginManager::GetPlugin(const char *Name)
return NULL;
}
-void cPluginManager::Shutdown(bool Log)
+void cPluginManager::StopPlugins(void)
+{
+ for (cDll *dll = dlls.Last(); dll; dll = dlls.Prev(dll)) {
+ cPlugin *p = dll->Plugin();
+ if (p && p->started) {
+ isyslog("stopping plugin: %s", p->Name());
+ p->Stop();
+ p->started = false;
+ }
+ }
+}
+
+void cPluginManager::Shutdown(void)
{
cDll *dll;
while ((dll = dlls.Last()) != NULL) {
- if (Log) {
- cPlugin *p = dll->Plugin();
- if (p)
- isyslog("stopping plugin: %s", p->Name());
- }
+ cPlugin *p = dll->Plugin();
+ if (p)
+ isyslog("deleting plugin: %s", p->Name());
dlls.Del(dll);
}
}