Calling exit()... without exiting

This is a discussion on Calling exit()... without exiting within the C Programming forums, part of the General Programming Boards category; I want to call exit() without exiting. I want to do this because I'm using a library (GTK) that uses ...

  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    2

    Calling exit()... without exiting

    I want to call exit() without exiting. I want to do this because I'm using a library (GTK) that uses exit() to clean up (I imagine it uses it in conjunction with atexit()), but I don't want to exit the program yet, I just want to have GTK clean up.

    Thanks,
    Jordy

  2. #2
    Registered User
    Join Date
    Jan 2009
    Posts
    21
    Perhaps there is another function to clean up?
    Rebuild GTK and have it clean up differently?

    exit() exits - that's what it does.
    What about exit() makes GTK clean up? If it is the action of ending the process then you will have to find some way to either fool it or fix and rebuild it. If it is attached to the exit() function then you could try to attach it to a different function.

  3. #3
    Registered User
    Join Date
    Nov 2009
    Posts
    2
    What I mean when I say "clean up" is that GTK deallocates what it's allocated in order to run. The problem is that I still want to continue running the program, just not the gui.

    In any case, I realized that this was a bad idea as it leaves a lot of garbage pointers hanging around. I've decided that letting GTK clean up by the exiting of the program is the best way to go.

  4. #4
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Katy, Texas
    Posts
    2,309
    Perhaps you could thread off the GTK piece of your app and wait in your primary thread while it runs.
    Mac and Windows cross platform programmer. Ruby lover.

    Quote of the Day
    12/20: Mario F.:I never was, am not, and never will be, one to shut up in the face of something I think is fundamentally wrong.

    Amen brother!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. calling functions: exit and return
    By 911help in forum C Programming
    Replies: 3
    Last Post: 12-28-2007, 12:24 PM
  2. Odd memory leaks
    By VirtualAce in forum C++ Programming
    Replies: 11
    Last Post: 05-25-2006, 12:56 AM
  3. calling exit() crashes
    By ichijoji in forum C++ Programming
    Replies: 4
    Last Post: 12-18-2005, 11:26 PM
  4. Dynamic array of pointers
    By csisz3r in forum C Programming
    Replies: 8
    Last Post: 09-25-2005, 02:06 PM
  5. Calling exit() with dynamic memory
    By miclus in forum C Programming
    Replies: 11
    Last Post: 10-05-2004, 11:49 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21