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

Opencv sgjava #4014

Merged
merged 2 commits into from May 14, 2015
Merged

Opencv sgjava #4014

merged 2 commits into from May 14, 2015

Conversation

sgjava
Copy link
Contributor

@sgjava sgjava commented May 13, 2015

Made generated delete() public instead of protected, so calling code can access.

Removed finalize() from Mat and added n_delete to release() to prevent native memory leaks.

@vpisarev vpisarev self-assigned this May 14, 2015
@vpisarev
Copy link
Contributor

👍

@opencv-pushbot opencv-pushbot merged commit 8b3b2a5 into opencv:master May 14, 2015
vpisarev added a commit that referenced this pull request May 14, 2015
@sgjava
Copy link
Contributor Author

sgjava commented May 14, 2015

✌️

@sgjava sgjava deleted the opencv-sgjava branch May 14, 2015 18:33
@sgjava sgjava mentioned this pull request May 17, 2015
@apavlenko
Copy link
Contributor

Actually before these changes there were two options for Java API users: calling Mat::release() manually for immediate native memory freeing or leaving objects as is so they are released via Mat::finalize() call from the garbage collector. During tutorials on OpenCV Java API we suggested calling Mat::release() in Java code for more efficient memory management but still made possible to ignore this and let the garbage collector do its work.
I strongly suggest reverting the changes made by this PR before 3.0 release!!!

@apavlenko
Copy link
Contributor

Also I'd like to note about the difference between Mat::release() and Mat object deletion: calling the 1st one we just free Mat memory allocated for the data, but the object is still usable again, while object deletion discards it totally. Please don't mix release() with delete!

apavlenko pushed a commit to apavlenko/opencv that referenced this pull request May 19, 2015
@sgjava
Copy link
Contributor Author

sgjava commented May 19, 2015

OK, I can separate the two again, but I'll add a releaseAndDelete(), so I don't have to do both in situations (most) that only release() is called.

mshabunin pushed a commit to mshabunin/opencv that referenced this pull request Aug 25, 2015
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.

None yet

4 participants