From d0249c8207351fb978b0bcd090c491443960a33b Mon Sep 17 00:00:00 2001 From: horchi Date: Sun, 19 Mar 2017 11:51:35 +0100 Subject: minor change --- epg2vdr.c | 7 ++++++- epg2vdr.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3