OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/base/resource/resource_bundle.h" | 5 #include "ui/base/resource/resource_bundle.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/stl_util-inl.h" | 8 #include "base/stl_util-inl.h" |
9 #include "base/string16.h" | 9 #include "base/string16.h" |
10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 delete resources_pak; | 24 delete resources_pak; |
25 resources_pak = NULL; | 25 resources_pak = NULL; |
26 } | 26 } |
27 return resources_pak; | 27 return resources_pak; |
28 } | 28 } |
29 | 29 |
30 } // namespace | 30 } // namespace |
31 | 31 |
32 ResourceBundle::~ResourceBundle() { | 32 ResourceBundle::~ResourceBundle() { |
33 FreeImages(); | 33 FreeImages(); |
34 #if defined(OS_POSIX) && !defined(OS_MACOSX) | |
35 FreeGdkPixBufs(); | |
36 #endif | |
37 UnloadLocaleResources(); | 34 UnloadLocaleResources(); |
38 STLDeleteContainerPointers(data_packs_.begin(), | 35 STLDeleteContainerPointers(data_packs_.begin(), |
39 data_packs_.end()); | 36 data_packs_.end()); |
40 delete resources_data_; | 37 delete resources_data_; |
41 resources_data_ = NULL; | 38 resources_data_ = NULL; |
42 } | 39 } |
43 | 40 |
44 void ResourceBundle::UnloadLocaleResources() { | 41 void ResourceBundle::UnloadLocaleResources() { |
45 delete locale_resources_data_; | 42 delete locale_resources_data_; |
46 locale_resources_data_ = NULL; | 43 locale_resources_data_ = NULL; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 // It's possible that there is no locale.pak. | 109 // It's possible that there is no locale.pak. |
113 NOTREACHED(); | 110 NOTREACHED(); |
114 return std::string(); | 111 return std::string(); |
115 } | 112 } |
116 locale_resources_data_ = LoadResourcesDataPak(locale_file_path); | 113 locale_resources_data_ = LoadResourcesDataPak(locale_file_path); |
117 CHECK(locale_resources_data_) << "failed to load locale.pak"; | 114 CHECK(locale_resources_data_) << "failed to load locale.pak"; |
118 return app_locale; | 115 return app_locale; |
119 } | 116 } |
120 | 117 |
121 } // namespace ui | 118 } // namespace ui |
OLD | NEW |