X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/84fff4d373d10a3676e239c02e759cffff5b5cf2..c00bc7c512b270dc02917bc8e582c77a95180499:/lib/gdi/grc.cpp diff --git a/lib/gdi/grc.cpp b/lib/gdi/grc.cpp index 274d221b..736630a8 100644 --- a/lib/gdi/grc.cpp +++ b/lib/gdi/grc.cpp @@ -63,6 +63,7 @@ void gRC::submit(const gOpcode &o) if ( tmp == rp ) { #ifndef SYNC_PAINT + pthread_cond_signal(&cond); // wakeup gdi thread pthread_mutex_unlock(&mutex); #else thread(); @@ -115,7 +116,11 @@ void *gRC::thread() else if (o.opcode==gOpcode::notify) need_notify = 1; else + { o.dc->exec(&o); + // o.dc is a gDC* filled with grabref... so we must release it here + o.dc->Release(); + } } else { @@ -237,7 +242,7 @@ void gPainter::renderText(const eRect &pos, const std::string &string, int flags o.dc = m_dc.grabRef(); o.parm.renderText = new gOpcode::para::prenderText; o.parm.renderText->area = pos; - o.parm.renderText->text = string; + o.parm.renderText->text = string.empty()?0:strdup(string.c_str()); o.parm.renderText->flags = flags; m_rc->submit(o); } @@ -539,7 +544,8 @@ void gDC::exec(gOpcode *o) assert(m_current_font); para->setFont(m_current_font); para->renderString(o->parm.renderText->text, (flags & gPainter::RT_WRAP) ? RS_WRAP : 0); - + if (o->parm.renderText->text) + free(o->parm.renderText->text); if (flags & gPainter::RT_HALIGN_RIGHT) para->realign(eTextPara::dirRight); else if (flags & gPainter::RT_HALIGN_CENTER)