After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 317775 - main loops continues to run after g_main_loop_quit() has been called
main loops continues to run after g_main_loop_quit() has been called
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: docs
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2005-10-02 22:51 UTC by Soren Sandmann Pedersen
Modified: 2011-02-18 16:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The program (467 bytes, text/plain)
2005-10-02 22:52 UTC, Soren Sandmann Pedersen
Details

Description Soren Sandmann Pedersen 2005-10-02 22:51:04 UTC
The program I will attach installs two idle handlers, where the first one calls
g_main_loop_quit() and the second one prints a message. The result of running
the program is that the second idle handler runs and prints the message, which
is wrong in my opinion.

I would expect g_main_loop_quit() to cause the main loop to stop running
immediately, not at some unspecified point in the future. If this is not
considered a bug, please at least mention this weird trap in the documentation.
Comment 1 Soren Sandmann Pedersen 2005-10-02 22:52:00 UTC
Created attachment 52951 [details]
The program
Comment 2 Owen Taylor 2005-10-03 00:10:38 UTC
It's just a natural consequence of the facts that:
 
 - g_main_context_iteration() dispatches all sources at the same priority
   in one go.

  - GMainLoop is a higher level object built on the low level, the  
    low level (mostly) doesn't know about it.

Feel free to suggest a doc improvement.
Comment 3 Matthias Clasen 2007-11-09 02:48:42 UTC
2007-11-08  Matthias Clasen <mclasen@redhat.com>

        * glib/gmain.c (g_main_loop_quit): Expand the docs
        a bit.  (#317775, Søren Sandmann)