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

EXCEPTION_ACCESS_VIOLATION closing Webcam #289

Closed
cristianchies opened this issue Jan 6, 2015 · 4 comments
Closed

EXCEPTION_ACCESS_VIOLATION closing Webcam #289

cristianchies opened this issue Jan 6, 2015 · 4 comments
Labels

Comments

@cristianchies
Copy link

I am facing this error, when i do fe following steps, on my project see Github's example here: webcam-capture-jafafx

1 - Star application (Main.java);
2 - Open Webcam preview by clicking on 'Dialog' Button;
3 - Select WebCam, Stop Webcam, Dispose Webcam and close the dialog;
When doing again, beginning from step 2, the application crashes when clicking on 'Dispose'.
See 'hs_err_pid2144.log' file for log details.

@sarxos
Copy link
Owner

sarxos commented Jan 11, 2015

Hi @Cerberous, I'm sorry to say, but I'm not very fluent in JavaFX and thus it's hard for me to understand what is happening inside this code. However, this kind of exception may be threw in some cases when more then one thread is accessing the same native reference. This should not happen if you are using Webcam class because it takes care of this.

Also, please do not dispose the webcam, it should be closed instead.

Can you share application debug logs?

@cristianchies
Copy link
Author

Hi @sarxos, I solved it just not calling Webcam.shutdown(), for some reason calling it, after closing webcam, it breaks on reopening the webcam dialog! Thanks for support!!

@sarxos
Copy link
Owner

sarxos commented Jan 12, 2015

@Cerberous, indeed, the Webcam.shutdown() may be safely invoked only when you are completely exiting JVM. Actually, you don't need to call it at all because JVM will dispose allocated Webcam instances for you, so this method is redundant. Just FYI, this method is useful only in case of Applets (due to their weird lifecycle).

@sarxos
Copy link
Owner

sarxos commented Jan 12, 2015

I updated examples for JavaFX so people are not confused.

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

No branches or pull requests

2 participants