Comments (6)
node.dispose() seems to work fine in a regular script:
https://gist.github.com/andreasplesch/a70a5544ce291e1d2708d0a7ec52746c
It returns and nulls the node. (But the scenegraph may not be updated).
So something else, investigating.
Hm, in the gist script SFNode.dispose() and X3DChildObject.dispose() is used, which does not appear to do much.
Whereas dom .x3d .dispose() calls X3DBaseNode.dispose();
from x_ite.
This for of loop keeps sometimes looping forever:
x_ite/src/x_ite/Basic/X3DBaseNode.js
Line 1048 in 082f4e8
The .values() iterator just keeps generating next values. Perhaps it has to do how the Proxy is used.
from x_ite.
Apparently, the never ending iterator has to do how the map is modified while being iterated. When I copy the parents map first to a new Map, the loop finishes and the node is disposed:
var firstParents = new Map(this .getParents ());
But of course I am not sure if this is correct.
It is probably necessary to copy the modified parent map back after the for loop:
this._parents = firstParents;
from x_ite.
Ok, I found that this test example
https://github.com/create3000/Library/blob/master/Tests/Components/Scripting/BaseNodeDispose.x3d
has the same issue. Clicking on the dispose box results in the infinite loop. Here a live scene:
from x_ite.
Fixed this in latest release and 'parents' are now a Set. 'Remove Box' in now working.
from x_ite.
Thanks. I can confirm. Here is the test example updated to the latest release:
[Since parents are objects, perhaps it is possible to use WeakSet for better garbage collection. Just an idea.]
from x_ite.
Related Issues (20)
- Error with createVrmlFromString in version 8.7.7 HOT 5
- MetadataSet proto causing failure to load on previously (recently) working world HOT 3
- Doubts at rendering the X3D component in DOM HOT 10
- TypeError while attempting to load a specific 3D Image from a base64 HOT 2
- How to use X_ITE with Electron? HOT 2
- Loading world from object URL hangs at loading screen if more assets are requested HOT 2
- xml x3d serialization of Proto Node field with init. value HOT 2
- glTF fails texture encoding test HOT 6
- Sound stereo direction in VRML HOT 4
- NavigationInfo @type is a JSON String not a JSON array. Data from browser.toJSONString() HOT 7
- X_ITE fails to load additional modules from my local server when loaded as ES6 module HOT 6
- How are relative internal URLs resolved when x3d content is supplied by string? HOT 1
- Shaders nearly working HOT 4
- Question: Where is the user interface for interacting with the viewer documented? HOT 12
- Question: Is it possible to build nodes in JavaScript and add them to a scene? HOT 5
- TypeScript types for x_ite HOT 13
- Issue with model in X3D archives HOT 2
- Can't use x_ite from inside a Firefox extension; can ResizeSensor.js be pruned? HOT 9
- Scientific data visualization HOT 6
- Weird shader effects, missing images, possibly due to reconfiguring Firewall, hostname, DNS servers HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from x_ite.