summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--epg2vdr.c7
-rw-r--r--epg2vdr.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/epg2vdr.c b/epg2vdr.c
index cb1d6ee..27f3ee9 100644
--- a/epg2vdr.c
+++ b/epg2vdr.c
@@ -411,6 +411,7 @@ void cMenuSetupEPG2VDR::Store()
cPluginEPG2VDR::cPluginEPG2VDR()
{
+ pluginInitialized = no;
oUpdate = 0;
connection = 0;
timerDb = 0;
@@ -801,7 +802,7 @@ cString cPluginEPG2VDR::SVDRPCommand(const char* cmd, const char* Option, int &R
bool cPluginEPG2VDR::Service(const char* id, void* data)
{
- if (!data)
+ if (!data || !pluginInitialized)
return fail;
tell(4, "Service called with '%s', %d/%d", id,
@@ -959,7 +960,10 @@ bool cPluginEPG2VDR::Start()
oUpdate = new cUpdate(this);
if (oUpdate->init() == success)
+ {
oUpdate->Start(); // start plugin thread
+ pluginInitialized = yes;
+ }
else
tell(0, "Initialization failed, start of plugin aborted!");
@@ -1050,6 +1054,7 @@ void cPluginEPG2VDR::Stop()
req.action = mieaExit;
Service(MYSQL_INIT_EXIT, &req);
+ pluginInitialized = no;
}
//***************************************************************************
diff --git a/epg2vdr.h b/epg2vdr.h
index c4e341b..172fdf0 100644
--- a/epg2vdr.h
+++ b/epg2vdr.h
@@ -70,6 +70,7 @@ class cPluginEPG2VDR : public cPlugin
private:
+ int pluginInitialized;
cDbConnection* connection;
cDbTable* timerDb;
cDbTable* vdrDb;