Thread: Calling exit()... without exiting

  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
    Chappell Hill, Texas
    Posts
    2,332
    Perhaps you could thread off the GTK piece of your app and wait in your primary thread while it runs.
    Mainframe assembler programmer by trade. C coder when I can.

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, 01: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-19-2005, 12:26 AM
  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