Jump to content

Camera: Contradiction in Doc for remove() and destroy()?


jamespierce
 Share

Recommended Posts

I apologize in advance if this should be obvious... Regarding destroying / removing cameras that I don't need anymore, I came across these two descriptions in the documentation that sound a bit contradicting to me:

Camera.destroy():

Quote
 

destroy()

Destroys this Camera instance. You rarely need to call this directly.

Called by the Camera Manager. If you wish to destroy a Camera please use CameraManager.remove as
cameras are stored in a pool, ready for recycling later, and calling this directly will prevent that.

CameraManager.remove(camera):

Quote
 

remove(camera)

Removes the given Camera, or an array of Cameras, from this Camera Manager.

If found in the Camera Manager it will be immediately removed from the local cameras array.
If also currently the 'main' camera, 'main' will be reset to be camera 0.

The removed Camera is not destroyed. If you also wish to destroy the Camera, you should call
Camera.destroy on it
, so that it clears all references to the Camera Manager.

So for destroy() it says that I should use CameraManager.remove(). However for remove() it says that I need to call Camera.destroy() to clear all references.

@rich  What's the "clean" way to do it? Call remove() first and then destroy() after? Or just one of the two?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...