summaryrefslogtreecommitdiff
path: root/xfa/fgas/crt
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fgas/crt')
-rw-r--r--xfa/fgas/crt/cfgas_formatstring.h3
-rw-r--r--xfa/fgas/crt/cfgas_formatstring_unittest.cpp1
2 files changed, 3 insertions, 1 deletions
diff --git a/xfa/fgas/crt/cfgas_formatstring.h b/xfa/fgas/crt/cfgas_formatstring.h
index 2cc5d569cd..3cbe6ff65a 100644
--- a/xfa/fgas/crt/cfgas_formatstring.h
+++ b/xfa/fgas/crt/cfgas_formatstring.h
@@ -10,6 +10,7 @@
#include <vector>
#include "core/fxcrt/locale_iface.h"
+#include "core/fxcrt/unowned_ptr.h"
#include "xfa/fxfa/parser/cxfa_localemgr.h"
bool FX_DateFromCanonical(const WideString& wsDate, CFX_DateTime* datetime);
@@ -67,7 +68,7 @@ class CFGAS_FormatString {
WideString* wsDatePattern,
WideString* wsTimePattern);
- CXFA_LocaleMgr* m_pLocaleMgr;
+ UnownedPtr<CXFA_LocaleMgr> m_pLocaleMgr;
};
#endif // XFA_FGAS_CRT_CFGAS_FORMATSTRING_H_
diff --git a/xfa/fgas/crt/cfgas_formatstring_unittest.cpp b/xfa/fgas/crt/cfgas_formatstring_unittest.cpp
index 51c001090c..afbd00f068 100644
--- a/xfa/fgas/crt/cfgas_formatstring_unittest.cpp
+++ b/xfa/fgas/crt/cfgas_formatstring_unittest.cpp
@@ -44,6 +44,7 @@ class CFGAS_FormatStringTest : public testing::Test {
// Note, this re-creates the fmt on each call. If you need to multiple
// times store it locally.
CFGAS_FormatString* fmt(const WideString& locale) {
+ fmt_.reset(); // Can't outlive |mgr_|.
mgr_ = pdfium::MakeUnique<CXFA_LocaleMgr>(nullptr, locale);
fmt_ = pdfium::MakeUnique<CFGAS_FormatString>(mgr_.get());
return fmt_.get();