It might be clearer in code:
var placemark = plugin.createPlacemark('id12345');
plugin.getFeatures().appendChild(placemark);
plugin.getFeatures().removeChild(placemark); // Now placemark is
removed from object hierarchy
// But 'placemark' JS variable still exists at this point, so we
can keep using it
plugin.getFeatures().appendChild(placemark); // Add it again
plugin.getFeatures().removeChild(placemark); // Remove it again
// Now delete JS variable
placemark = null;
// We've now removed all references to the placemark (both in JS and
in Earth's features hierarchy)
// BUT, the placemark JS variable won't actually be destryoed until
the JS garbage collector kicks in.
// Technically, the variable still exists (as far as the browser is
concerned) until the garbage
// collector takes it away.
Hope that clarifies things.
- Paul