xforms-development
[Top][All Lists]
Advanced

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

Re: [XForms] Segfault after fl_finish and fix


From: Steven G. Messervey
Subject: Re: [XForms] Segfault after fl_finish and fix
Date: Wed, 5 Oct 2016 10:49:26 -0400

-----Original Message-----
From: Jens Thoms Toerring [mailto:address@hidden 
Sent: Tuesday, October 04, 2016 11:57 AM
To: Steven G. Messervey <address@hidden>; address@hidden
Subject: Re: [XForms] Segfault after fl_finish and fix

Hi Steven,

On Tue, Oct 04, 2016 at 11:16:26AM -0400, Steven G. Messervey wrote:
>   Yes, I see what you are saying.
> I got hung up on a line from the manual:
> "The most important function for doing the actual interaction with 
> forms is
> 
> FL_OBJECT *fl_do_forms(void);
> 
> It starts the main loop of the program and returns only when either 
> the state of an object changes that has no callback bound to it or 
> fl_finish() is called in a callback. In the first case the address of 
> the object is returned, in the latter NULL."
> 
> (xforms_38.html#Part-V-Overview-of-Main-Functions,  a little after the 
> discussion of fl_hide_form).

Thanks for bringing this to my attention since this is obviously untrue! I
think the expectation was that the callback calls exit() after fl_finish().
As you've found out the hard way things go badly wrong when hoping for it to
make fl_do_forms() return NULL. My gut feelung at the moment is the proper
fix is to check after each call of obj->object_callback() if XForms is still
alive (e.by by checking fli_context for NULL or fl_display for
None) and, if not, immediatel return, similar to what you proposed, but at
every such call.

> I need it to return so the interpreter can process an exit call and do 
> other cleanup (close shared libraries, close files, etc.).

I see. That sounds like a perfectly reasonable use of that feature. Please
give me a bit of time to think this through, at the moment my workload is a
bit on the high side...

                           Best ergards, Jens
-- 
  \   Jens Thoms Toerring  ________      address@hidden
   \_______________________________      http://toerring.de


I understand, that's huge change. 
The local patch I made works well enough for my immediate use case, so I am
in no rush.

Thanks,
  Steve M.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]