Skip to content

Commit a390eac

Browse files
Fix crash in IceTransport::TimeoutCallback with libnice
1 parent e25a5fd commit a390eac

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/impl/icetransport.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -604,16 +604,14 @@ IceTransport::IceTransport(const Configuration &config, candidate_callback candi
604604
}
605605

606606
IceTransport::~IceTransport() {
607-
if (mTimeoutId) {
608-
g_source_remove(mTimeoutId);
609-
mTimeoutId = 0;
610-
}
611-
612607
PLOG_DEBUG << "Destroying ICE transport";
613608
nice_agent_attach_recv(mNiceAgent.get(), mStreamId, 1, g_main_loop_get_context(MainLoop.get()),
614609
NULL, NULL);
615610
nice_agent_remove_stream(mNiceAgent.get(), mStreamId);
616611
mNiceAgent.reset();
612+
613+
if (mTimeoutId)
614+
g_source_remove(mTimeoutId);
617615
}
618616

619617
Description::Role IceTransport::role() const { return mRole; }

0 commit comments

Comments
 (0)