if (rdr == null) {
if (rdr == null || ctx == 0) {
    void freeContextResources(Renderer rdr, boolean freeBackground,			      long ctx) {	Object obj;	TextureRetained tex;	DetailTextureImage detailTex;		if (rdr == null) {	    return;	}	if (freeBackground) {	    // Free Background Texture	    // Note that we use non-shared ctx to create	    // it so there is no need to do so in 	    // Renderer.freeContextResources()	    if (rdr.objectId > 0) {		Canvas3D.freeTexture(ctx, rdr.objectId);		VirtualUniverse.mc.freeTexture2DId(rdr.objectId);			rdr.objectId = -1;	    }	    // Free Graphics2D Texture	    if ((graphics2D != null) &&		(graphics2D.objectId != -1)) {		Canvas3D.freeTexture(ctx, graphics2D.objectId);		VirtualUniverse.mc.freeTexture2DId(graphics2D.objectId);		graphics2D.objectId = -1;	    }	}		for (int id = textureIDResourceTable.size()-1; id > 0; id--) {	    obj = textureIDResourceTable.get(id);	    if (obj == null) {		continue;	    }	    freeTexture(ctx, id);	    if (obj instanceof TextureRetained) {		tex = (TextureRetained) obj;		synchronized (tex.resourceLock) {		    tex.resourceCreationMask &= ~canvasBit;		    if (tex.resourceCreationMask == 0) {			tex.freeTextureId(id);		    }		}	    } else if (obj instanceof DetailTextureImage) {		detailTex = ((DetailTextureImage) obj);		detailTex.freeDetailTextureId(id, canvasBit);	    }	}	textureIDResourceTable.clear();		freeAllDisplayListResources();    }