B4J Question mac app quit problem

tufanv

Expert
Licensed User
Longtime User
Hello,

I have an interesting problem. I have 2 other apps on the macstore compiled with java9 and Janpro's packager tool. They are working without problem. I have a new app , Now I tried at my mac , when I close the app , app seems to be closed , but at the bottom where mac apps are listed it has a black dot under it which means app is still active. When I click on it , the app is not shown , I click fore quit and apple error appears saying app is unresposnive , do you want to send report to apple etc..

I tried it without using the packager tool , as pure java , same thing happens. App is not closing completely. The error report apple shows is million lines.

After some further investigating I found out that , this happens when the websocket is connected ( active ) while the user is closing the app. If the websocket is closed before hitting quit , app closes without problem.

How can i close the websocket with ws.close when the user clicks on mac's quit button , is there any event to understand this and close the websocket ?
 
Last edited:

Lahksman

Active Member
Licensed User
Longtime User
I think you have to use CloseRequest.

B4X:
public Sub frm_CloseRequest (e As Event)
    e.Consume
    ws.close
    ...
End Sub
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
I think you have to use CloseRequest.

B4X:
public Sub frm_CloseRequest (e As Event)
    e.Consume
    ws.close
    ...
End Sub
Yes thanks . I also found it after searching with different keywords:

B4X:
Sub MainForm_CloseRequest (EventData As Event)
    Log("Closing")
End Sub
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…