
| Key: |
LPP-1071
|
| Type: |
Task
|
| Status: |
Closed
|
| Resolution: |
Fixed
|
| Priority: |
--
|
| Assignee: |
Unassigned
|
| Reporter: |
John Sundman
|
| Votes: |
0
|
| Watchers: |
1
|
|
If you were logged in you would be able to see more operations.
|
|
|
OpenLaszlo
Created: 28/Nov/05 04:08 AM
Updated: 10/May/07 02:40 PM
|
|
| Component/s: |
Documentation
|
| Affects Version/s: |
3.1 (aka Denver)
|
| Fix Version/s: |
4.0.2
|
|
| Severity: |
Minor
|
| Runtime: |
N/A
|
|
Sorry, I forgot to attach the code. Here it is.
Marcos
<canvas width="100%" height="100%" debug="true">
<debug x="10" y="300" width="800" height="300" />
<import name="form_tenforty_snippet"
href="1040/form_tenforty.lzx" stage="defer"
onload="mybutt.handleTenFortyLoad()" />
<button name="mybutt">Load 1040 now
<!-- The instance of the form -->
<attribute name="f" value="null" />
<attribute name="is_tenforty_loaded" value="false" />
<method event="onclick">
if ( this.is_tenforty_loaded ) {
instantiateTenForty();
} else {
form_tenforty_snippet.load();
}
</method>
<method name="handleTenFortyLoad">
this.is_tenforty_loaded = true;
instantiateTenForty();
</method>
<method name="instantiateTenForty">
//this.f = new form_tenforty( canvas, {x:40,y:40});
this.f = new form_tenforty( this, {x:40,y:40});
</method>
</button>
<button x="130">Remove 1040 now
<method event="onclick">
mybutt.f.destroy();
mybutt.setAttribute("f", null);
delete mybutt.f;
delete form_tenforty_snippet;
//mybutt.f = null;
//canvas.f.destroy();
//canvas.f = null;
</method>
</button>
<button x="280">markObjects
<method event="onclick">
__LzDebug.markObjects();
</method>
</button>
<button x="390">findNewObjects
<method event="onclick">
__LzDebug.findNewObjects();
</method>
</button>
<button x="520">whyAlive
<method event="onclick">
var foo = __LzDebug.whyAlive();
//foo.toString();
Debug.write("Why Alive: ", foo, foo.toString());
</method>
</button>
<!--
<button x="610">backtrace
<method event="onclick">
Debug.backtrace();
</method>
</button>
-->
</canvas>
_____________
|
|
Description
|
Sorry, I forgot to attach the code. Here it is.
Marcos
<canvas width="100%" height="100%" debug="true">
<debug x="10" y="300" width="800" height="300" />
<import name="form_tenforty_snippet"
href="1040/form_tenforty.lzx" stage="defer"
onload="mybutt.handleTenFortyLoad()" />
<button name="mybutt">Load 1040 now
<!-- The instance of the form -->
<attribute name="f" value="null" />
<attribute name="is_tenforty_loaded" value="false" />
<method event="onclick">
if ( this.is_tenforty_loaded ) {
instantiateTenForty();
} else {
form_tenforty_snippet.load();
}
</method>
<method name="handleTenFortyLoad">
this.is_tenforty_loaded = true;
instantiateTenForty();
</method>
<method name="instantiateTenForty">
//this.f = new form_tenforty( canvas, {x:40,y:40});
this.f = new form_tenforty( this, {x:40,y:40});
</method>
</button>
<button x="130">Remove 1040 now
<method event="onclick">
mybutt.f.destroy();
mybutt.setAttribute("f", null);
delete mybutt.f;
delete form_tenforty_snippet;
//mybutt.f = null;
//canvas.f.destroy();
//canvas.f = null;
</method>
</button>
<button x="280">markObjects
<method event="onclick">
__LzDebug.markObjects();
</method>
</button>
<button x="390">findNewObjects
<method event="onclick">
__LzDebug.findNewObjects();
</method>
</button>
<button x="520">whyAlive
<method event="onclick">
var foo = __LzDebug.whyAlive();
//foo.toString();
Debug.write("Why Alive: ", foo, foo.toString());
</method>
</button>
<!--
<button x="610">backtrace
<method event="onclick">
Debug.backtrace();
</method>
</button>
-->
</canvas>
_____________ |
Show » |
|
To 'unload' a snippet, three things have to be done:
1. Destroy all the instances that were created by the snippet.
This is done by calling `iii.destroy();` for each instance
iii. Note that if you have created references to the instance
outside of the snippet, you must `delete` those references.
2. Destroy all classes that were created by the snippet. This
is done by calling `ccc.destroy();` for each class ccc. Note
that if you have created references to the class outside of
the snippet, you must `delete` those references.
3. Unload the snippet. This is done by calling
`sss.unload()`, where sss is the name of the snippet (in the
import tag).
At this point, you can re-load the snippet by calling
`sss.load()`. If you know you will never use the snippet
again, you can call `sss.destroy();` to remove the snippet
from your application altogether.