mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 522948 - crash at shutdown with geo.enabled=false [@nsCOMArray_base::InsertObjectAt(nsISupports*, int)]. r=dougt
This commit is contained in:
parent
a116a29917
commit
ab3b004ea6
@ -365,12 +365,6 @@ GeoEnabledChangedCallback(const char *aPrefName, void *aClosure)
|
||||
|
||||
nsresult nsGeolocationService::Init()
|
||||
{
|
||||
nsCOMPtr<nsIObserverService> obs = do_GetService("@mozilla.org/observer-service;1");
|
||||
if (!obs)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
obs->AddObserver(this, "quit-application", false);
|
||||
|
||||
mTimeout = nsContentUtils::GetIntPref("geo.timeout", 6000);
|
||||
|
||||
nsContentUtils::RegisterPrefCallback("geo.enabled",
|
||||
@ -391,6 +385,13 @@ nsresult nsGeolocationService::Init()
|
||||
if (!catMan)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
// geolocation service can be enabled -> now register observer
|
||||
nsCOMPtr<nsIObserverService> obs = do_GetService("@mozilla.org/observer-service;1");
|
||||
if (!obs)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
obs->AddObserver(this, "quit-application", false);
|
||||
|
||||
nsCOMPtr<nsISimpleEnumerator> geoproviders;
|
||||
catMan->EnumerateCategory("geolocation-provider", getter_AddRefs(geoproviders));
|
||||
if (geoproviders) {
|
||||
|
Loading…
Reference in New Issue
Block a user