mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-30 01:59:29 +00:00
Bug 1054908 - Ensure socket_child_ is released on main thread. r=mt
This commit is contained in:
parent
eb440bb46b
commit
b2c0e8a827
@ -1026,12 +1026,13 @@ void NrSocketIpc::create_m(const nsACString &host, const uint16_t port) {
|
||||
ReentrantMonitorAutoEnter mon(monitor_);
|
||||
|
||||
nsresult rv;
|
||||
socket_child_ = do_CreateInstance("@mozilla.org/udp-socket-child;1", &rv);
|
||||
nsCOMPtr<nsIUDPSocketChild> socketChild = do_CreateInstance("@mozilla.org/udp-socket-child;1", &rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
err_ = true;
|
||||
MOZ_ASSERT(false, "Failed to create UDPSocketChild");
|
||||
}
|
||||
|
||||
socket_child_ = new nsMainThreadPtrHolder<nsIUDPSocketChild>(socketChild);
|
||||
socket_child_->SetFilterName(nsCString("stun"));
|
||||
|
||||
if (NS_FAILED(socket_child_->Bind(this, host, port))) {
|
||||
|
@ -58,6 +58,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "nsXPCOM.h"
|
||||
#include "nsIEventTarget.h"
|
||||
#include "nsIUDPSocketChild.h"
|
||||
#include "nsProxyRelease.h"
|
||||
|
||||
#include "databuffer.h"
|
||||
#include "m_cpp_utils.h"
|
||||
@ -233,7 +234,7 @@ private:
|
||||
NrSocketIpcState state_;
|
||||
std::queue<RefPtr<nr_udp_message> > received_msgs_;
|
||||
|
||||
nsCOMPtr<nsIUDPSocketChild> socket_child_;
|
||||
nsMainThreadPtrHandle<nsIUDPSocketChild> socket_child_;
|
||||
nsCOMPtr<nsIEventTarget> sts_thread_;
|
||||
const nsCOMPtr<nsIEventTarget> main_thread_;
|
||||
ReentrantMonitor monitor_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user