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

[rust] RsModel delete model in close #3170

Merged
merged 2 commits into from
May 10, 2024
Merged

Conversation

xyang16
Copy link
Contributor

@xyang16 xyang16 commented May 10, 2024

Description

Brief description of what this PR is about

  • If this change is a backward incompatible change, why must this change be made?
  • Interesting edge cases to note here

@xyang16 xyang16 requested review from zachgk, frankfliu and a team as code owners May 10, 2024 00:19
@xyang16 xyang16 force-pushed the rust branch 2 times, most recently from 3780fe3 to 780a6e4 Compare May 10, 2024 00:21
/** {@inheritDoc} */
@Override
public void close() {
if (handle != -1) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    Long pointer = handle.getAndSet(null);
    if (pointer != null) {
        RustLibrary.deleteModel(handle);
    }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

@xyang16 xyang16 force-pushed the rust branch 2 times, most recently from 59905d6 to e970288 Compare May 10, 2024 03:56
@xyang16 xyang16 merged commit 5c691c0 into deepjavalibrary:master May 10, 2024
5 checks passed
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.

2 participants