canvasIdAlloc = false;
    public void removeNotify() {        // Do nothing for manually-rendered off-screen canvases        if (manualRendering) {            return;        }	Renderer rdr = null;	if (isRunning && (screen != null)) {	    // If there is other Canvas3D in the same screen	    // rendering, stop it before JDK create new Canvas	    rdr = screen.renderer;	    if (rdr != null) {		VirtualUniverse.mc.postRequest(MasterControl.STOP_RENDERER, rdr);		while (!rdr.userStop) {		    MasterControl.threadYield();		}	    }	}	// Note that although renderer userStop is true,	// MasterControl can still schedule renderer to run through	// runMonotor(RUN_RENDERER_CLEANUP) which skip userStop	// thread checking.	// For non-offscreen rendering the following call will	// block waiting until all resources is free before 	// continue	synchronized (drawingSurfaceObject) {	    validCtx = false;	    validCanvas = false;	}	removeCtx();        Pipeline.getPipeline().freeDrawingSurface(this, drawingSurfaceObject);        // Clear first paint and visible flags        firstPaintCalled = false;	visible = false;	screen.removeUser(this);	evaluateActive();        VirtualUniverse.mc.freeCanvasId(canvasId);	canvasBit = 0;	canvasId = 0;	ra = null;	graphicsContext3D = null;	ctx = null;	// must be after removeCtx() because 	// it will free graphics2D textureID	graphics2D = null;	super.removeNotify();	// This may happen if user explicity call this before 	// addNotify()	if (eventCatcher != null) {	    this.removeComponentListener(eventCatcher);	    this.removeFocusListener(eventCatcher);	    this.removeKeyListener(eventCatcher);	    this.removeMouseListener(eventCatcher);	    this.removeMouseMotionListener(eventCatcher);	    this.removeMouseWheelListener(eventCatcher);	    eventCatcher.reset();	}	if (canvasViewEventCatcher != null) {	    if (canvasViewEventCatcher.parentList.size() > 0) {		//Release and clear.		for(int i=canvasViewEventCatcher.parentList.size()-1; i>=0; i--) {		    Component comp = 			(Component)canvasViewEventCatcher.parentList.get(i);		    comp.removeComponentListener(canvasViewEventCatcher);		}		canvasViewEventCatcher.parentList.clear();	    }	    	    // Need to traverse up the parent and remove listener.	    this.removeComponentListener(canvasViewEventCatcher);	}	if (parent != null) {	    ((Window)parent).removeWindowListener(eventCatcher);	    if (VirtualUniverse.mc.isD3D()) {		((Window)parent).removeComponentListener(eventCatcher);	    }	}	if (parent != null) {	    parent.requestFocus();	}        added = false;	if (rdr != null) {            // Issue 84: Send a message to MC to restart renderer            VirtualUniverse.mc.postRequest(MasterControl.START_RENDERER, rdr);            while (rdr.userStop) {                MasterControl.threadYield();            }	}        // Fix for issue 102 removing strong reference and avoiding memory leak        // due retention of parent container                this.parent = null;    }