-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Don't use std::unique_ptr for SVEvent #3870
Conversation
@@ -836,7 +836,7 @@ char ScrollView::Wait() { | |||
char ret = '\0'; | |||
SVEventType ev_type = SVET_ANY; | |||
do { | |||
std::unique_ptr<SVEvent> ev(AwaitEvent(SVET_ANY)); | |||
SVEvent *ev(AwaitEvent(SVET_ANY)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4.0.0 already used std::unique_ptr
for this functionality (see code).
I didn’t test against 4.0.0.
4.1.3:
~/tesseract4.1.3$ grep unique_ptr src/viewer/scrollview.cpp
~/tesseract4.1.3$
|
Conclusion: Also /src/cutil/callcpp.cpp contains a unique_ptr-construction, but that’s probably not getting ‘delete’d. The big log is not falling over it.
I think a clear choice has to be made between using those std::-constructs and make the Java-application use them as well, or just remove them.
|
For 4.x that code was in callcpp.cpp (see link in my previous comment). |
Yes. I saw that on second look. My commit primarily reverses your second commit, but hardly the first one. I wonder whether those other variables are also transferred to and from Java, and whether the std:: -wrapping gives trouble with the Java-application. |
Replaced by #3872. |
#3869