Re: [sigc] libsigc problems
- From: Paul Davis <paul linuxaudiosystems com>
- To: luca <luca cappa i-medlab com>
- Cc: libsigc-list gnome org
- Subject: Re: [sigc] libsigc problems
- Date: Tue, 29 Nov 2005 17:28:01 -0500
On Tue, 2005-11-29 at 22:20 +0100, luca wrote:
> void emitSignal ()
> {
> signal.*emit* ();
> }
>
> void on (X* x)
> {
> *delete* *this*;
> }
> };
>
[ ... ]
> since i destroyed the object i am emitting the signal from (and also the
> slot will be destroyed indeed). Anyone has a better design to avoid this
> problem?
in a Gtk/Glib context, i have:
template<typename T> gint idle_delete (T *obj) { delete obj; return
FALSE; }
template<typename T> void delete_when_idle (T *obj) {
Glib::signal_idle().connect (sigc::bind (sigc::ptr_fun
(idle_delete<T>), obj));
}
you would need some equivalent of Glib::signal_idle()
--p
[
Date Prev][
Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]