Greetings,

I started noticing that event strings are being corrupted and I have found
the culprit.

Signal::set_name() does not copy the buffer that is given to it:

3970 void set_name(const char *name) {
3971 name_ = name;
3972 }

and SET_SIGNAL_CB deletes the stringbuffer after it builds the string and
passes the buffer to set_name():

78 #define SET_SIGNAL_CB(name, name_postfix, signal, cb) \
79 { \
80 stringbuf *sg_n = new stringbuf(); \
81 *sg_n << name, name_postfix; \
82 signal.set_name(sg_n->buf); \
83 signal.connect(signal_mem_ptr(*this, cb)); \
*84 delete sg_n; \ *
85 }

The fix is trivial: remove the delete sg_n from the macro.

-Paul
_______________________________________________
http://www.marss86.org
Marss86-Devel mailing list
[email protected]
https://www.cs.binghamton.edu/mailman/listinfo/marss86-devel

Reply via email to