[rkward-cvs] rkward/rkward/rbackend rcommandreceiver.h,1.3,1.4

Thomas Friedrichsmeier tfry at users.sourceforge.net
Wed Oct 26 16:10:34 UTC 2005


Update of /cvsroot/rkward/rkward/rkward/rbackend
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24964/rkward/rbackend

Modified Files:
	rcommandreceiver.h 
Log Message:
Fixed random crash while deleting RKLoadLibsDialog. Workaround for rare crash in RControlWindow

Index: rcommandreceiver.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rbackend/rcommandreceiver.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** rcommandreceiver.h	9 Sep 2005 13:02:57 -0000	1.3
--- rcommandreceiver.h	26 Oct 2005 16:10:32 -0000	1.4
***************
*** 34,46 ****
      virtual ~RCommandReceiver () {};
  	int numCommandsOut () { return num_commands_waiting; };
! 	void deleteThis () { if (num_commands_waiting > 0) { deleted=true; } else { delete this; } };
  protected:
  	friend class RCommand;
  	virtual void rCommandDone (RCommand *command) = 0;
  private:
  	int num_commands_waiting;
  	bool deleted;
  	void addCommand () { ++num_commands_waiting; };
! 	void delCommand () { if ((--num_commands_waiting <= 0) && deleted) { delete this; } };
  };
  
--- 34,48 ----
      virtual ~RCommandReceiver () {};
  	int numCommandsOut () { return num_commands_waiting; };
! 	void deleteThis () { if (num_commands_waiting > 0) { deleted=true; } else { deleteThisNow (); } };
  protected:
  	friend class RCommand;
  	virtual void rCommandDone (RCommand *command) = 0;
+ /** calls "delete this" immediately (called from deleteThis ()). Virtual so you can use some other method of destruction, e.g. QObject::deleteLater (). */
+ 	virtual void deleteThisNow () { delete this; };
  private:
  	int num_commands_waiting;
  	bool deleted;
  	void addCommand () { ++num_commands_waiting; };
! 	void delCommand () { if ((--num_commands_waiting <= 0) && deleted) { deleteThisNow (); } };
  };
  





More information about the rkward-tracker mailing list