Skip to content

Protect pointer after calling release methods #19

Open
@blueberry

Description

@blueberry

Scenarios:

  1. some of the enqueueReleaseX methods is called twice on the same objects
  2. an operation that needs valid context is called after the context has been released

Result: JVM crashes

This is expected behavior, but I am wondering whether there is a way to keep a flag in all NativePointerObject instances, that tracks whether the pointer is "valid"? This might result in exceptions, but at least the majority of JVM crashes could be avoided.

I also believe it could be backwards compatible, since the flag setting and checking would be an internal thing that does not have to be exposed to clients.

This issue is relevant to JCuda, too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions