Re: [gtk-list] Signals and malloced memory




Derek Simkowiak <dereks@kd-dev.com> writes:
> 	gtkeditable.h has the following comment in its class struct
> definition, just above its list of virtual functions:
> 
>   /* Virtual functions. get_chars is in paricular not a signal because
>    * it returns malloced memory. The others are not signals because
>    * they would not be particularly useful as such. (All changes to
>    * selection and position do not go through these functions)
>    */
> 
> 	My question is about "get_chars is in paricular not a signal
> because it returns malloced memory".  This implies that I can't emit a
> signal whose handler takes a pointer to something my object malloced.
> 

The comment says you can't _return_ malloced memory, it doesn't say
anything about the arguments.

(If you could return malloced memory, what happens if there are two
signal handlers?)

Havoc



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