<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>938</bug_id>
          
          <creation_ts>2014-01-09 17:07:37 +0100</creation_ts>
          <short_desc>MemoryObject.java has no more equals() method</short_desc>
          <delta_ts>2014-01-14 05:39:26 +0100</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>opengl</component>
          <version>2</version>
          <rep_platform>All</rep_platform>
          <op_sys>all</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Franco">fzanelli</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          
          
          <cf_type>DEFECT</cf_type>
          <cf_scm_refs>6c971f91fbe6a7e3bc45563d80d42a753586d629</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>3558</commentid>
    <comment_count>0</comment_count>
    <who name="Franco">fzanelli</who>
    <bug_when>2014-01-09 17:07:37 +0100</bug_when>
    <thetext>Unlike version 2.0rc11, in version 2.1.3 the class MemoryObject hasn&apos;t equals() method. In this way getOrAddSafe() add always the object even if the object is already in the map, se we have memory leak.

In my opinion you need to reintroduce the following method:
public boolean equals(Object obj) {
        if(this == obj) { return true; }
        if(obj instanceof MemoryObject) {
            MemoryObject m = (MemoryObject) obj;
            return addr == m.addr &amp;&amp; size == m.size ;
        }
        return false;
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3577</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2014-01-14 05:39:26 +0100</bug_when>
    <thetext>Thank you for finding this regression!

+++

    Bug 938 - MemoryObject.java has no more equals() method
    
    Re-adding &apos;equals(..)&apos; method erroneously removed with commit 8457bf35fee253d9af29ff1150a9671f6896fc17.
    
    &apos;equals(..)&apos; is important to allow the HashMap&lt;&gt; for glMapBuffer(..) work properly!

+++

Further GLBufferStateTracker / glMapBuffer work is underway,
please see Bug 942 and review/help.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>