Closing my app gracefully?


#1

Hi all,

I was wondering if juce provides some callback or equiv that let’s me code some routines to gracefully shutdown running threads etc.
I can do this from a file -> exit, but i need to catch a system ‘close app’ call, eg, if a user closes the window with the operating system’s windowing manager…

?

Thanks,
Radiance


#2

The JUCEApplication object gets a callback when the user tries to quit, or catch DocumentWindow::closeButtonPressed for just a single window being closed…


#3

thanks a bunch,
i’ll see if i can get that to work :slight_smile:

Radiance


#4

hi jules,

When I debug my code and quit the application using the Activity monitor the application crashes in

bool juce_dispatchNextMessageOnSystemQueue (bool returnIfNoPendingMessages)

is there something wrong in the mac windowing??


#5

Does the juce demo crash in the same way? Or is it just your own app?


#6

I dint check the juce demo app.

but my test app had only content component nothing else. So its basically a basic juce window.

Regards
Godwin


#7

I’ll repeat:

Does the juce demo crash in the same way? Or is it just your own app?


#8

Dint got time to build juce demo. I never used it for reference. ( basically i dont want to build )

So its in my app and i dont know about the juce demo.

Regards
Godwin.


#9

[quote]Dint got time to build juce demo. I never used it for reference. ( basically i dont want to build )

So its in my app and i dont know about the juce demo. [/quote]

If the juce demo crashes, I’m interested. If it doesn’t, then it’s a bug in your own code and you’d better get on with tracking it down.


#10

Ha Ha Ha

For U Jules i built juce demo for first time in my life. But the bug is same its crashed in

void MessageManager::runDispatchLoop()

My reply is ur own reply

And for God sake stop blaming others. ( I did because someone forced me to do it )//better not to mention ur name.


#11

Don’t get shitty with me or you’ll be off this forum quick as a flash.

And “ha ha ha” back at you, because this isn’t my fault - it’s your own misunderstanding.

Presumably it’s “force quit” you’re pressing, not “quit” (which works perfectly).

And the app gets a SIGTERM in the dispatch loop. Wow, no shit? How exactly did you think “force quit” works? Do you think that perhaps it sends a TERMination SIGnal to the app? :roll:


#12

This was ur replay when u answered the first post in this thread

Regards
Godwin


#13

Eh? My original replies were perfectly correct - why are you re-quoting them?


#14