зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1136729: Make destructor of |SocketBase| protected, r=qdot
The destructor methods of ref-counted classes are supposed to be non-public to prevent accidential deletion. This patch fixes |SocketBase|'s destructor.
This commit is contained in:
Родитель
6561622ac7
Коммит
94a9c39fe7
|
@ -168,11 +168,6 @@ UnixSocketRawData::Send(int aFd)
|
|||
// SocketBase
|
||||
//
|
||||
|
||||
SocketBase::~SocketBase()
|
||||
{
|
||||
MOZ_ASSERT(mConnectionStatus == SOCKET_DISCONNECTED);
|
||||
}
|
||||
|
||||
SocketConnectionStatus
|
||||
SocketBase::GetConnectionStatus() const
|
||||
{
|
||||
|
@ -247,6 +242,11 @@ SocketBase::SocketBase()
|
|||
, mConnectDelayMs(0)
|
||||
{ }
|
||||
|
||||
SocketBase::~SocketBase()
|
||||
{
|
||||
MOZ_ASSERT(mConnectionStatus == SOCKET_DISCONNECTED);
|
||||
}
|
||||
|
||||
void
|
||||
SocketBase::SetConnectionStatus(SocketConnectionStatus aConnectionStatus)
|
||||
{
|
||||
|
|
|
@ -211,8 +211,6 @@ class SocketBase
|
|||
public:
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(SocketBase)
|
||||
|
||||
virtual ~SocketBase();
|
||||
|
||||
SocketConnectionStatus GetConnectionStatus() const;
|
||||
|
||||
int GetSuggestedConnectDelayMs() const;
|
||||
|
@ -256,6 +254,7 @@ public:
|
|||
|
||||
protected:
|
||||
SocketBase();
|
||||
virtual ~SocketBase();
|
||||
|
||||
void SetConnectionStatus(SocketConnectionStatus aConnectionStatus);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче