Skip to content

Commit ea839c0

Browse files
committed
check lock on weak_ptr
1 parent 8a7d27f commit ea839c0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Engine.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ void Engine::add_subscriber(sg4::ActorPtr actor)
8383

8484
void Engine::close_stream() const
8585
{
86-
stream_.lock()->close();
86+
if (auto s = stream_.lock())
87+
s->close();
8788
}
8889
/// \endcond
8990

0 commit comments

Comments
 (0)