diff options
author | anbr <vdr07@deltab.de> | 2009-05-30 17:20:44 +0200 |
---|---|---|
committer | anbr <vdr07@deltab.de> | 2009-05-30 17:20:44 +0200 |
commit | f7474de7957369a17754f558890d803ce9d5dc0f (patch) | |
tree | c6b89618b3caa0f1457d5b9bc11510f15eb2a744 /imon.c | |
parent | e35905da3b8f38ef246df5316f56ae623fd3f1db (diff) | |
download | vdr-plugin-imonlcd-f7474de7957369a17754f558890d803ce9d5dc0f.tar.gz vdr-plugin-imonlcd-f7474de7957369a17754f558890d803ce9d5dc0f.tar.bz2 |
enable/disable imonlcd with svdrp (Request #128)
Diffstat (limited to 'imon.c')
-rw-r--r-- | imon.c | 39 |
1 files changed, 24 insertions, 15 deletions
@@ -122,20 +122,6 @@ ciMonLCD::ciMonLCD() ciMonLCD::~ciMonLCD() { this->close(); - - if(pFont) { - delete pFont; - pFont = NULL; - } - if(framebuf) { - delete framebuf; - framebuf = NULL; - } - if(backingstore) { - delete backingstore; - backingstore = NULL; - } - } @@ -249,6 +235,20 @@ void ciMonLCD::close() ::close(this->imon_fd); this->imon_fd = -1; } + + if(pFont) { + delete pFont; + pFont = NULL; + } + if(framebuf) { + delete framebuf; + framebuf = NULL; + } + if(backingstore) { + delete backingstore; + backingstore = NULL; + } + } @@ -272,6 +272,11 @@ bool ciMonLCD::flush() unsigned char msb; int offset = 0; + if(this->imon_fd<0) { + esyslog("iMonLCD: error writing to dead file descriptor"); + return false; + } + /* * The display only provides for a complete screen refresh. If * nothing has changed, don't refresh. @@ -484,7 +489,11 @@ bool ciMonLCD::icons(int state) bool ciMonLCD::SendCmd(const uint64_t & cmdData) { unsigned int i; unsigned char buf[8]; - + + if(this->imon_fd<0) { + esyslog("iMonLCD: error writing to dead file descriptor"); + return false; + } //dsyslog("iMonLCD: writing : %08llx", cmdData); /* Fill the send buffer. */ |