Open sfesenko opened 2 years ago
How is this code even reached? By the time this call to g_main_loop_quit()
is executed, g_main_loop_run()
must already have terminated, so... the main loop isn't running?
Put differently: Is this really fixing a bug in the test or is this just modifying the test to mask "the real problem"?
IMO, error
doesn't terminate main loop, so after pcall
program has illegal state (exit from main loop without terminating it).
So, in other news, the whole test is invalid and needs to be deleted? (Or better: Replaced with something else that still tests whatever this test is supposed to test, but without being invalid)
What exactly does "doesn't terminate main loop" mean? Obviously g_main_loop_run()
is no longer running...?
What exactly does "doesn't terminate main loop" mean? Obviously g_main_loop_run() is no longer running...?
I guess, without g_main_loop_quit()
call main loop is still active, so whole program enters abnormal state (since it exit main loop without g_main_loop_quit()
call)
So, in other news, the whole test is invalid and needs to be deleted?
All tests are executed in the same context, so each test should be responsible for cleaning up allocated resources.
And, main loop must be terminated by g_main_loop_quit()
before exit corocbk.rethrow()
To sum up:
error
should implicitly clean up all allocated resources (i.e. do g_main_loop_quit()
call), then there is "the real problem", since this doesn't work.
g_main_loop_quit()
just should be called explicitly, so main loop will be gracefully terminated and wont affect execution. (May be using xpcall
with error handler that call g_main_loop_quit()
would be more descriptive)
Test (whole process) fails for luajit2.1 without correct termination of main loop