-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crash at program termination after using gtk native file chooser #6
Comments
I experience the problem on Ubuntu 16.04, too. I also see the following error message on the command line: It is generated in the Tomorrow I'll investigate further. |
The problem with Under current Manjaro the GTK filechooser is correctly shown. The crash here happens at program exit when the Lua state is closed and frees all shared object (native lua modules). The crash happens only at program exit when die GTK file chooser was invoked. If the GTK file chooser was not invoked, program termination is OK. The problematic call is in Best regards, |
I see... and Not closing the Lua state causes memory leaks, which should not be a great deal on most system. Can we live with it, for now? |
Yes, I think it's not a real problem, it's only a problem for ending the application and therefore memory leaks are not a real problem. We should adjust the examples to call |
In the example
editor.lua
the program is terminated withos.exit(true, true)
. This leads to a crash after the gtk native file chooser was invoked (at least under current Manjaro Linux, latest release MoonFLTK 0.5 und also current git master), stacktrace:The program does not crash if terminating with
os.exit(true, false)
or if the FLTK file chooser is used instead of the GTK one.The problem is, that the second
true
argument inos.exit
leads to closing thelua_State
before the exit handlers are called. In lua sourceloadlib.c
one can see that closing the lua state unloads all native shared objects, e.g.moonfltk.so
. Unloadingmoonfltk.so
seems to unload some other shared objects that are needed by another exit handler: if the call todlclose
inlua/loadlib.c
is commented out, than no crash does occur.I did not find a better solution than just quitting the application with
os.exit(true, false)
.The text was updated successfully, but these errors were encountered: