<p>I'm developping my own classes using the "OpenLayers.Class" class. However, I'm wondering something regarding the destroy method.</p>

<p>I created my own class that doesn't inherit from any other. That class has a few properties with values and initialize and destroy methods among others. In my destroy method, I assign null values to my properties to prevent memory leaks. Here's something that looks like it:</p>

<code><pre>
ExampleClass = OpenLayers.Class(
{
  property: "defaultValue",

  initialize: function(options)
  {
    // Do Stuff
  },
  
  destroy: function()
  {
    // Do Stuff
    this.property = null;
  },

  CLASS_NAME: "ExampleClass"
});
</pre></code>

<p>I assumed that calling the destroy method on an object of that class would clear that object's properties. However, it seems that the destroy call will nullify the assigned properties of the "OpenLayers.Class" object. That means that every new instance of the class won't have the defaultly assigned property. </p>

Example: 
<code><pre>
var obj = new ExampleClass(); // obj will have its property to "defaultValue"
obj.destroy(); // Destroy the obj instance.
var obj2 = new ExampleClass(); // obj will have its property nullified!
</pre></code>

Could anyone tell me how to proceed so that destroy() will nullify the <strong>instantiated object</strong> property instead of nullifying that class's property.

<p>Help would be immensely appreciated. Thank you.</p>
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://osgeo-org.1803224.n2.nabble.com/OpenLayers-Class-destroy-method-question-tp6985999p6985999.html">OpenLayers.Class destroy method question</a><br/>
Sent from the <a href="http://osgeo-org.1803224.n2.nabble.com/OpenLayers-Users-f1822463.html">OpenLayers Users mailing list archive</a> at Nabble.com.<br/>