run Code when closing without interfering

edited February 2015 in How To...

hello everyone

im using processing with oscP5 and pure data to communicate with each other.

whats working: processing sends pure data command to start and pure data starts sending information back.

whats not working: when closing processing it should send pure data a command to stop sending information. i tried using exit() and it works but it also messes up the standard oscP5 closing routine, which leaves some processes open in the background.

question: is there any way to insert the stop message form processing to pure data without messing up the closing routine of oscP5? before oscP5 is closed, of course.

sincerely

Answers

  • edited February 2015 Answer ✓

    You may try to @Override the exit() function:

    @ Override void exit() {
      // Call finalizing stuff below:
      // ...
      super.exit(); // Now call original exit()
    }
    
  • youre my hero!!

  • btw. how do i mark this thread as answered?

  • edited February 2015

    Since this forum was upgraded a while ago, I'm afraid we can't anymore! :(
    In order to do so, the thread gotta be of type "Question" rather than "Discussion".
    We're still awaiting for a fix soon! =P~

  • Changed the type of thread to Question, so you can mark the answer as accepted.

  • Oh, I still need to find out where that type swap is hiding! b-(

  • First message, the gear icon, Q&A menu item at the end... :-) Was easier when we could do that from editing the message, as we could both move it and change its type.

    The forum now defaults to Discussion instead of Question, which is unfortunate as a vast majority of threads are to ask questions.

Sign In or Register to comment.