Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(485)

Side by Side Diff: src/gpu/GrAutoLocaleSetter.h

Issue 1493913008: Speculative fix for win8 bot crash in ~GrAutoLocaleSetter (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef GrAutoLocaleSetter_DEFINED 8 #ifndef GrAutoLocaleSetter_DEFINED
9 #define GrAutoLocaleSetter_DEFINED 9 #define GrAutoLocaleSetter_DEFINED
10 10
(...skipping 24 matching lines...) Expand all
35 } else { 35 } else {
36 fOldLocale = static_cast<locale_t>(0); 36 fOldLocale = static_cast<locale_t>(0);
37 } 37 }
38 #else 38 #else
39 (void) name; // suppress unused param warning. 39 (void) name; // suppress unused param warning.
40 #endif 40 #endif
41 } 41 }
42 42
43 ~GrAutoLocaleSetter () { 43 ~GrAutoLocaleSetter () {
44 #if defined(SK_BUILD_FOR_WIN) 44 #if defined(SK_BUILD_FOR_WIN)
45 setlocale(LC_ALL, fOldLocale); 45 if (fOldLocale) {
46 setlocale(LC_ALL, fOldLocale);
47 }
46 _configthreadlocale(fOldPerThreadLocale); 48 _configthreadlocale(fOldPerThreadLocale);
47 #elif !defined(SK_BUILD_FOR_ANDROID) && !defined(__UCLIBC__) 49 #elif !defined(SK_BUILD_FOR_ANDROID) && !defined(__UCLIBC__)
48 if (fLocale) { 50 if (fLocale) {
49 uselocale(fOldLocale); 51 uselocale(fOldLocale);
50 freelocale(fLocale); 52 freelocale(fLocale);
51 } 53 }
52 #endif 54 #endif
53 } 55 }
54 56
55 private: 57 private:
56 #if defined(SK_BUILD_FOR_WIN) 58 #if defined(SK_BUILD_FOR_WIN)
57 int fOldPerThreadLocale; 59 int fOldPerThreadLocale;
58 const char* fOldLocale; 60 const char* fOldLocale;
59 #elif !defined(SK_BUILD_FOR_ANDROID) && !defined(__UCLIBC__) 61 #elif !defined(SK_BUILD_FOR_ANDROID) && !defined(__UCLIBC__)
60 locale_t fOldLocale; 62 locale_t fOldLocale;
61 locale_t fLocale; 63 locale_t fLocale;
62 #endif 64 #endif
63 }; 65 };
64 66
65 #endif 67 #endif
66 68
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698