I do not understand
[code]void AnimatingScene::SetupViewport()
{
Renderer* renderer = GetSubsystem();
// Set up a viewport to the Renderer subsystem so that the 3D scene can be seen
SharedPtr<Viewport> viewport(new Viewport(context_, scene_, cameraNode_->GetComponent<Camera>()));
renderer->SetViewport(0, viewport);
}
[/code]
SharedPtr viewport is local variable
SharedPtr viewport convert to raw pointer Viewport* (reference count not increased) and used in SetViewport()
SharedPtr viewport deleted as local variable (reference count == 0)
Why Viewport* is not destroyed?