Skip to content
Browse files

Bug 589721 - Segfault when closing remote tab with open geolocation p…

…rompt. r=dougt a=blocking-fennec=2.0a1+

--HG--
branch : GECKO20b5pre_20100820_RELBRANCH
  • Loading branch information...
1 parent 110d1dd commit 9de36149224afb32b93371ce6c9cb757e3f37fbb @jdm jdm committed Aug 23, 2010
Showing with 8 additions and 3 deletions.
  1. +2 −0 dom/ipc/TabChild.cpp
  2. +6 −3 dom/src/geolocation/nsGeolocation.cpp
View
2 dom/ipc/TabChild.cpp
@@ -86,6 +86,7 @@
#include "nsSerializationHelper.h"
#include "nsIFrame.h"
#include "nsIView.h"
+#include "nsGeolocation.h"
#ifdef MOZ_WIDGET_QT
#include <QX11EmbedWidget>
@@ -983,6 +984,7 @@ TabChild::AllocPGeolocationRequest(const IPC::URI&)
bool
TabChild::DeallocPGeolocationRequest(PGeolocationRequestChild* actor)
{
+ static_cast<nsGeolocationRequest*>(actor)->Release();
return true;
}
View
9 dom/src/geolocation/nsGeolocation.cpp
@@ -1019,10 +1019,13 @@ nsGeolocation::RegisterRequestWithPrompt(nsGeolocationRequest* request)
// the one and only TabChild.
TabChild* child = GetTabChildFrom(window->GetDocShell());
- PGeolocationRequestChild* a =
- child->SendPGeolocationRequestConstructor(request, IPC::URI(mURI));
+ child->SendPGeolocationRequestConstructor(request, IPC::URI(mURI));
+
+ // Retain a reference so the object isn't deleted without IPDL's knowledge.
+ // Corresponding release occurs in DeallocPGeolocationRequest.
+ request->AddRef();
- (void) a->Sendprompt();
+ unused << request->Sendprompt();
return;
}
#endif

0 comments on commit 9de3614

Please sign in to comment.
Something went wrong with that request. Please try again.