Skip to content

Conversation

blink1073
Copy link
Collaborator

Fixes #168, addresses #164.

I could not find a way to reliably interrupt the Matlab process and recover from it, but at least now Ctrl+C results in a clean shutdown of the Matlab process.

@arokem
Copy link
Owner

arokem commented Apr 24, 2015

Whoops. Sorry that it's taken so long to look at this. Looks good!

arokem added a commit that referenced this pull request Apr 24, 2015
Fix matlabserver shutdown behavior
@arokem arokem merged commit 314d049 into arokem:master Apr 24, 2015
@isbadawi
Copy link
Collaborator

@blink1073 Can you explain why onCleanup is needed here?

I ask because it looks like Octave doesn't like you calling exit or quit inside an onCleanup handler, so this error always gets printed when we exit:

error: quit: not supported in embedded mode
error: called from:
error:    at line -1, column -1
error:   /Users/isbadawi/code/py/python-matlab-bridge/pymatbridge/matlab/matlabserver.m at line 12, column 1

@blink1073
Copy link
Collaborator Author

@isbadawi, it was needed to make sure Matlab actually shut down.

@blink1073
Copy link
Collaborator Author

You could try wrapping it in a try block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When a socket-connected matlab instance is already present mlab.start() creates another matlab instance but connects to the one already available
3 participants