[英]Live555 RTSPServer object destroyed improperly or the library bug?
I have a problem with destroying RTSPServer
object: the app crashes with a SIGSEGV
Error. 我在销毁RTSPServer
对象时遇到问题:应用程序崩溃并出现SIGSEGV
错误。 But the RTSPServer
object might be destroyed only in the case if I do not touch all other objects. 但是,如果我不触及所有其他对象,则可能仅销毁RTSPServer
对象。 Is this a library bug or am I doing something wrong? 这是库错误还是我做错了什么?
Their recent live555 changelog says: 他们最近的live555更改日志说:
2015.05.12:
- Updated the previous revision to change the order in which fields are deleted
in the "RTSPServer" destructor, to avoid a possible crash if "RTSPServer"
objects are deleted. (Thanks to ChaSeop Im for noting the problem.)
This is my destructor: 这是我的析构函数:
RTSPServerH264::~RTSPServerH264()
{
LOG(INFO) << "RTSP server close: destroying objects";
if (mSms.size() > 0)
{
LOG(INFO) << "destroying: Server Media Subsession vector";
for (ServerMediaSession* s : mSms)
{
s->deleteAllSubsessions();
Medium::close(s);
}
mSms.clear();
mLiveSubsession.clear();
}
if (mRTSPServer)
{
LOG(INFO) << "destroying: RTSPServer";
// BUG: Destroying RTSPServer object crashes the whole application!
Medium::close(mRTSPServer);
}
if (mUsageEnvironment)
{
LOG(INFO) << "destroying: Usage Environment";
mUsageEnvironment->reclaim();
}
if (mTaskScheduler)
{
LOG(INFO) << "destroying: Task Scheduler";
delete mTaskScheduler;
}
}
The answer to my question is now available here: http://lists.live555.com/pipermail/live-devel/2015-June/019490.html 现在可以在这里找到我的问题的答案: http : //lists.live555.com/pipermail/live-devel/2015-June/019490.html
Response text: 回复文字:
I have a problem using
Medium::close()
in my destructor when deleting anRTSPServer
object after I have already deletedServerMediaSession*
objects vector (of course, usingMedium::close()
too). 在我已经删除了ServerMediaSession*
对象向量(当然,也使用Medium::close()
)之后删除RTSPServer
对象时,我在析构函数中使用Medium::close()
时RTSPServer
。First, make sure that you are using the latest version of the software (a bug related to deleting
RTSPServer's
was fixed in version 2015.06.24). 首先,请确保您使用的是最新版本的软件(在2015.06.24版中修复了与删除RTSPServer's
相关的错误)。Second, be aware that once you have added a
ServerMediaSession
object to aRTSPServer
, you must not delete theServerMediaSession
object by callingMedium::close()
. 其次,请注意,一旦将ServerMediaSession
对象添加到RTSPServer
,就不能通过调用Medium::close()
删除ServerMediaSession
对象。 Instead, you must useGenericMediaServer::deleteServerMediaSession()
(GenericMediaServer
is the base class ofRTSPServer
), so that theRTSPServer
is told that theServerMediaSession
object is being deleted. 相反,你必须使用GenericMediaServer::deleteServerMediaSession()
GenericMediaServer
是基类的RTSPServer
),从而使RTSPServer
被告知ServerMediaSession
对象被删除。Finally, however, note that you don't need to delete
ServerMediaSession
objects before you delete aRTSPServer
, because theRTSPServer
destructor will automatically delete anyServerMediaSession
(andClientConnection
andClientSession
) objects that it manages. 最后,但是,请注意,您不必删除ServerMediaSession
对象在删除之前RTSPServer
,因为RTSPServer
析构函数将自动删除任何ServerMediaSession
(和ClientConnection
和ClientSession
)对象所管理。 Instead, you can just callMedium::close()
on yourRTSPServer
object. 相反,您可以在RTSPServer
对象上调用Medium::close()
。Ross Finlayson, Live Networks, Inc., http://www.live555.com/ Ross Finlayson,Live Networks,Inc。, http://www.live555.com/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.