Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RAII in Matlab. #1

Open
brotchie opened this issue May 15, 2012 · 0 comments
Open

RAII in Matlab. #1

brotchie opened this issue May 15, 2012 · 0 comments

Comments

@brotchie
Copy link
Owner

Matlab provides a very useful onCleanup function that allows any function to be run when a function exits. This allows RAII style programming with legacy code.

The correct RAII solution is to encapsulate resource handles in classes and explicitly clean the resource (close file handles, database connections, etc) when instances of that class fall out of scope.

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

No branches or pull requests

1 participant