Achim Tuffentsammer wrote:
Nicolas Huillard wrote:
Since cOsdProvider::NewOsd() can return NULL, osd->anything shouldn't
be called without testing.
I simply cannot decide how to handle the case, since we are in the
constructor cSkinSTTNGDisplayMessage::cSkinSTTNGDisplayMessage and
many methods after that will try to use the osd property, and
crash... The cSkinSTTNGDisplayMessage should simply abort it's
construction, but I don't know how to write it in C++...
Why don't you simply return from the constructor after NewOsd returns
NULL?
There was a patch posted some days ago concerning this problem:
http://www.linuxtv.org/mailinglists/vdr/2004/07-2004/msg00520.html
I started from this post and the answer from Klaus, and went Klaus's
way. See attached patch.
This patch solve the problem, whatever skin is used. The other way would
involve patching every skin, to check the return value of
cOsdProvider::NewOsd(), that can be NULL. This fix would be necessary,
but involve each and every method of all skins around... I'm just lazy.
Lazyness was not the Good Thing this time... This patch effectively
disables confirmation prompts shown when deleting a recording, a timer,
etc...