g_atexit

"Richard Warren" <[email protected]>
Newsgroups gmane.comp.video.gimp.windows.devel
Organization Primagraphics Ltd.
Message-ID <013e01c2949c$a0ef46c0$3d00a8c0@primag>
Dear all,

Has anybody used GLib's g_atexit() function in a Windows application?

I don't think it works properly since my callback function doesn't get
invoked when my Win32 application exits, although it works perfectly okay on
Linux.

The simple test case attached to this email should show the problem.  I
never see the "This is the exitFunc()." message, but if the g_atexit() call
is changed to an ordinary atexit() call then it works.

Am I doing something stupid?

(I'm using the latest GLib build from Tor, V2.0.6 I think).

Thanks,
Richard.


To Post a message, send it to:   [email protected]
To Unsubscribe, send a blank message to: [email protected] 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
atexit.c (application/octet-stream, 351 B)
#include <stdio.h>
#include <stdlib.h>
#include <glib.h>

static void exitFunc(void);

int main(int argc, char *argv[])
{
    printf("Installing function to call on exit.\n");
    g_atexit(exitFunc);

    printf("Exiting.\n");
    exit(0);
}

/* Callback function. */
static void exitFunc(void)
{
    printf("This is the exitFunc().\n");
    return;
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.