On shutdown, the renderer might already be gone.
Check for this when trying to remove the event handler.
This commit is contained in:
parent
16ae171333
commit
5d2bb87601
1 changed files with 4 additions and 1 deletions
|
@ -275,7 +275,10 @@ PUICamera::~PUICamera()
|
||||||
{
|
{
|
||||||
SG_LOG(SG_GL, SG_INFO, "Deleting PUI camera");
|
SG_LOG(SG_GL, SG_INFO, "Deleting PUI camera");
|
||||||
|
|
||||||
auto viewer = globals->get_renderer()->getViewer();
|
// depending on if we're doing shutdown or reset, various things can be
|
||||||
|
// null here.
|
||||||
|
auto renderer = globals->get_renderer();
|
||||||
|
auto viewer = renderer ? renderer->getViewer() : nullptr;
|
||||||
if (viewer) {
|
if (viewer) {
|
||||||
viewer->removeEventHandler(_eventHandler);
|
viewer->removeEventHandler(_eventHandler);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue