This is a question regarding an issue raised by this bug which Andre reported<br><br><a href="http://jira.openlaszlo.org/jira/browse/LPP-4688">http://jira.openlaszlo.org/jira/browse/LPP-4688</a><br><br>In his test case, he has code which creates a (globally) named dataset , creates a view which uses it in a datapath,
<br>then destroys the datapath and creates a new one with the same name<br><br> <method name="createDataset" args="name, local, text" ><![CDATA[<br> var ds = new LzDataset(local ? this : canvas, {"name":name});
<br> ds.appendChild(new LzDataElement("test", {}, [new LzDataText(text)]));<br> return ds;<br> ]]></method><br> <br> <method name="test_1" ><![CDATA[
<br> var ds = this.createDataset("dsdyn1", false, "foo");<br> var text = new lz.text(this, {id:"leak1", datapath:"dsdyn1:/test/text()", visible:false});<br>
ds.destroy();<br> ds = this.createDataset("dsdyn1", false, "bar");<br><br>There's two issues, one is how to make sure that when you destroy a dataset, all the views which are bound to it
<br>release their pointers. <br><br>The other issue is should there be some mechanism so that if a new dataset is created with the same name, that<br>views which reference it in their datapath should rebind to the new dataset automatically? That seems like a hard
<br>problem to me, and aside from the cost and complexity to maintain it. I don't know how often people<br>destroy and create datasets, but I always considered them as permanent, in that you can<br>reload them or clear out their contents, but destroying and recreating one with the same
<br>name is something I had not considered. <br><br><br><br clear="all"><br>-- <br>Henry Minsky<br>Software Architect<br><a href="mailto:hminsky@laszlosystems.com">hminsky@laszlosystems.com</a><br><br>