diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2005-01-30 14:23:01 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2005-01-30 14:23:01 +0100 |
commit | 2bec1d5ca0aad0bc18d99ed33c1b1ce443abb699 (patch) | |
tree | 744c9c05dd6ed3922174a93ed515581e64bc4dfd /plugin.c | |
parent | a430f64252f5b38bb19dc151c3793d66d64a8fb7 (diff) | |
download | vdr-2bec1d5ca0aad0bc18d99ed33c1b1ce443abb699.tar.gz vdr-2bec1d5ca0aad0bc18d99ed33c1b1ce443abb699.tar.bz2 |
Added cPlugin::Stop()
Diffstat (limited to 'plugin.c')
-rw-r--r-- | plugin.c | 30 |
1 files changed, 23 insertions, 7 deletions
@@ -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); } } |