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

Fix / Avoid double Release() in FindCaptureDevice() #65

Merged
merged 1 commit into from
Apr 14, 2023

Conversation

markmaker
Copy link

Description

This fixes a semantic conflict from merging 5e8b963 of #53 which inside FindCaptureDevice() was using ScopedComPtr<> to handle ownership of pMoniker implicitly, and 58d4be4 of #52 which was using an explicit Release() on pMoniker. Both by @sandman42292 in time- and branch-overlapping PRs.

Screenshot 2023-04-12 143612

Justification

Crashes on Windows.

Testing

Tested with win/test/openpnp-capture-test.exe. This crashed before and now works.

I was unable to test this in OpenPnP, due to lack of knowledge of how to put the dll "into" Java, in a development environment, i.e., make it override maven artifacts. 😅

Instructions welcome!

This fixes a semantic conflict from merging 5e8b963 using ScopedComPtr<> and 58d4be4 using explicit Release().
@lags
Copy link

lags commented Apr 13, 2023

Maybe you can use maven offline mode and set local repository for expose your build.
For more information you can check here

@markmaker
Copy link
Author

Thanks @lags,

I already tried replacing the artifact .dll in the maven repo cache .jar archive, to no avail. It did not appear to download a fresh version after my manipulation, but it also did not take the new .dll from the cache, it seems.

I'm sure there is some regular way to do JNI development/debugging etc. locally, side-by-side, otherwise this would be "stone-age", wouldn't it?

I hope @vonnieda can clear this up.

_Mark

@vonnieda
Copy link
Member

Thanks @markmaker - will get this all sorted out today.

@vonnieda vonnieda merged commit 982f21c into openpnp:master Apr 14, 2023
@vonnieda
Copy link
Member

If you modify a local artifact (in .m2/repo) you need to mvn clean to clear your target directory.

It's a search chain that goes:

  • project/target
  • ~/.m2/repo
  • repos defined in pom.xml
  • Maven Central

When you debug/develop this stuff locally, you end up having a few helper scripts to build and move things into the right places to test with. Instructions are in this repo for setting up builds, then in openpnp-capture-java for setting up builds, and then ultimately openpnp.

And yes, it's all very stone age. Multi-platform FFI in Java has barely changed for the better in 20 years, and it changes for the worse every time a new update comes out. That's why no one wants to maintain this shit :)

Jason

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.

3 participants