Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] [PATCH] text2skin segfault on exit



Found the error which made text2skin crash on exit: cListObject ojects
must be allocated with new because of the delete in cListBase::Clear().
Fix attached.

One might argue this is a bug in the VDR core, because
cListBase::Del() already has the DeleteObject flag - perhaps for
reasons like this - but then the question remains what to do in
cListBase::~cListBase(). Oh well.

(This nicely illustrates one of the reasons why I hate C++.)

Olaf

--- text2skin-0.0.8/status.c	Sat Jun 12 21:17:06 2004
+++ text2skin-0.0.8-patched/status.c	Sun Sep 12 12:28:33 2004
@@ -4,7 +4,7 @@

 #include "status.h"

-cText2SkinStatus cText2SkinStatus::mStatus;
+cText2SkinStatus *cText2SkinStatus::mStatus = new cText2SkinStatus;

 cText2SkinStatus::cText2SkinStatus(void) {
 	mReplayMode = replayNone;
diff -bur text2skin-0.0.8/status.h text2skin-0.0.8-patched/status.h
--- text2skin-0.0.8/status.h	Sat Jun 12 21:17:06 2004
+++ text2skin-0.0.8-patched/status.h	Sun Sep 12 12:29:21 2004
@@ -10,7 +10,7 @@

 class cText2SkinStatus: public cStatus {
 private:
-	static cText2SkinStatus mStatus;
+	static cText2SkinStatus *mStatus;

 	eReplayMode mReplayMode;

@@ -20,7 +20,7 @@
 	virtual void Replaying(const cControl *Control, const char *Name);

 public:
-	static eReplayMode ReplayMode(void) { return mStatus.mReplayMode; }
+	static eReplayMode ReplayMode(void) { return mStatus->mReplayMode; }
 };

 #endif // VDR_TEXT2SKIN_STATUS_H

=== end of patch ===






Home | Main Index | Thread Index