From 828e1b8a8228f06a038c97b1ceaf68a2062692c2 Mon Sep 17 00:00:00 2001 From: Jonathan Kew Date: Mon, 25 Nov 2019 13:55:05 +0000 Subject: [PATCH] Bug 1598656 - Ensure RoUninitialize is not called until after the COMPtr<>s have been released. r=emk Differential Revision: https://phabricator.services.mozilla.com/D54505 --HG-- extra : moz-landing-system : lando --- intl/locale/windows/OSPreferences_win.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/intl/locale/windows/OSPreferences_win.cpp b/intl/locale/windows/OSPreferences_win.cpp index edc6f40626fd..51397cf6abe6 100644 --- a/intl/locale/windows/OSPreferences_win.cpp +++ b/intl/locale/windows/OSPreferences_win.cpp @@ -65,12 +65,11 @@ bool OSPreferences::ReadSystemLocales(nsTArray& aLocaleList) { } } } - - // Only close the runtime if we successfully initialized it above, - // otherwise we assume it was already in use and should be left as is. - if (SUCCEEDED(inited)) { - RoUninitialize(); - } + } + // Only close the runtime if we successfully initialized it above, + // otherwise we assume it was already in use and should be left as is. + if (SUCCEEDED(inited)) { + RoUninitialize(); } } #endif