On Sat, Jun 17, 2017 at 11:25 PM, el es via Lazarus <lazarus@lists.lazarus-ide.org> wrote: > But when, during the course of Queue()d callback, > I FreeAndNil() the object that had the pointer to the callback procedure, I > get SIGSEGV pointing at CheckSynchronize in Application. (address F0F0F0F0).
I don't know the details of this issue but address F0F0F0F0 means you used compiler flag -gt (trash variables) and the variable is uninitialized or already freed. Yes, the flag -gt is good, helps find such errors. > Hence the question is, how can I know it is safe to free the object, > that has the callback subscribed to it? > One of the ways would be, to have a flag in that object, that the > callback proc will set, and so the thread will know it's now safe to > Free(andNil)() it. A flag in an uninitialized or freed object does not help. Juha -- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus-ide.org http://lists.lazarus-ide.org/listinfo/lazarus