Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8309599

WeakHandle and OopHandle release should clear obj pointer

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 22
    • 21
    • hotspot
    • b18

      They clear the handle but not the pointer. They should clear the pointer too so you can test whether the handle is released in some cases.

      inline void OopHandle::release(OopStorage* storage) {
        if (_obj != nullptr) {
          // Clear the OopHandle first
          NativeAccess<>::oop_store(_obj, nullptr);
          storage->release(_obj);
        }
      }

            coleenp Coleen Phillimore
            coleenp Coleen Phillimore
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: