Merge lp:~unity-api-team/indicator-network/lp1411714-15.04 into lp:indicator-network/15.04
- lp1411714-15.04
- Merge into trunk.15.04
Proposed by
Antti Kaijanmäki
Status: | Merged |
---|---|
Approved by: | Antti Kaijanmäki |
Approved revision: | 472 |
Merged at revision: | 474 |
Proposed branch: | lp:~unity-api-team/indicator-network/lp1411714-15.04 |
Merge into: | lp:indicator-network/15.04 |
Diff against target: |
364 lines (+76/-78) 4 files modified
src/dbus-cpp/services/ofono.h (+10/-4) src/indicator/modem.cpp (+53/-58) src/menumodel-cpp/gio-helpers/util.cpp (+12/-15) src/menumodel-cpp/gio-helpers/util.h (+1/-1) |
To merge this branch: | bzr merge lp:~unity-api-team/indicator-network/lp1411714-15.04 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Antti Kaijanmäki (community) | Approve | ||
Review via email:
|
Commit message
* Guard access to ofono::Modem properties that have a
shared_ptr inside them with a mutex.
* simplify GMainLoopDispatcher
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/dbus-cpp/services/ofono.h' | |||
2 | --- src/dbus-cpp/services/ofono.h 2014-10-23 21:46:41 +0000 | |||
3 | +++ src/dbus-cpp/services/ofono.h 2015-01-30 12:31:15 +0000 | |||
4 | @@ -1034,8 +1034,9 @@ | |||
5 | 1034 | break; | 1034 | break; |
6 | 1035 | case Property::Interfaces::Type::NetworkRegistration: | 1035 | case Property::Interfaces::Type::NetworkRegistration: |
7 | 1036 | { | 1036 | { |
8 | 1037 | std::unique_lock<std::mutex> lock(_lock); | ||
9 | 1037 | if (std::find(newInterfaces.begin(), newInterfaces.end(), known) == newInterfaces.end() && | 1038 | if (std::find(newInterfaces.begin(), newInterfaces.end(), known) == newInterfaces.end() && |
11 | 1038 | networkRegistration->get()) { | 1039 | networkRegistration.get()) { |
12 | 1039 | networkRegistration.set(std::shared_ptr<NetworkRegistration>()); | 1040 | networkRegistration.set(std::shared_ptr<NetworkRegistration>()); |
13 | 1040 | } | 1041 | } |
14 | 1041 | break; | 1042 | break; |
15 | @@ -1046,8 +1047,9 @@ | |||
16 | 1046 | break; | 1047 | break; |
17 | 1047 | case Property::Interfaces::Type::SimManager: | 1048 | case Property::Interfaces::Type::SimManager: |
18 | 1048 | { | 1049 | { |
19 | 1050 | std::unique_lock<std::mutex> lock(_lock); | ||
20 | 1049 | if (std::find(newInterfaces.begin(), newInterfaces.end(), known) == newInterfaces.end() && | 1051 | if (std::find(newInterfaces.begin(), newInterfaces.end(), known) == newInterfaces.end() && |
22 | 1050 | simManager->get()) { | 1052 | simManager.get()) { |
23 | 1051 | simManager.set(std::shared_ptr<SimManager>()); | 1053 | simManager.set(std::shared_ptr<SimManager>()); |
24 | 1052 | } | 1054 | } |
25 | 1053 | break; | 1055 | break; |
26 | @@ -1080,7 +1082,8 @@ | |||
27 | 1080 | break; | 1082 | break; |
28 | 1081 | case Property::Interfaces::Type::NetworkRegistration: | 1083 | case Property::Interfaces::Type::NetworkRegistration: |
29 | 1082 | { | 1084 | { |
31 | 1083 | if (!networkRegistration->get()) { | 1085 | std::unique_lock<std::mutex> lock(_lock); |
32 | 1086 | if (!networkRegistration.get()) { | ||
33 | 1084 | networkRegistration.set(std::make_shared<NetworkRegistration>(this->object)); | 1087 | networkRegistration.set(std::make_shared<NetworkRegistration>(this->object)); |
34 | 1085 | } | 1088 | } |
35 | 1086 | break; | 1089 | break; |
36 | @@ -1091,7 +1094,8 @@ | |||
37 | 1091 | break; | 1094 | break; |
38 | 1092 | case Property::Interfaces::Type::SimManager: | 1095 | case Property::Interfaces::Type::SimManager: |
39 | 1093 | { | 1096 | { |
41 | 1094 | if (!simManager->get()) { | 1097 | std::unique_lock<std::mutex> lock(_lock); |
42 | 1098 | if (!simManager.get()) { | ||
43 | 1095 | simManager.set(std::make_shared<SimManager>(this->object)); | 1099 | simManager.set(std::make_shared<SimManager>(this->object)); |
44 | 1096 | } | 1100 | } |
45 | 1097 | break; | 1101 | break; |
46 | @@ -1174,6 +1178,8 @@ | |||
47 | 1174 | 1178 | ||
48 | 1175 | std::shared_ptr<core::dbus::Signal<Signal::PropertyChanged, Signal::PropertyChanged::ArgumentType>> propertyChanged; | 1179 | std::shared_ptr<core::dbus::Signal<Signal::PropertyChanged, Signal::PropertyChanged::ArgumentType>> propertyChanged; |
49 | 1176 | 1180 | ||
50 | 1181 | // this lock must be acquired for any access to networkRegistration or simManager | ||
51 | 1182 | std::mutex _lock; | ||
52 | 1177 | core::Property<NetworkRegistration::Ptr> networkRegistration; | 1183 | core::Property<NetworkRegistration::Ptr> networkRegistration; |
53 | 1178 | core::Property<SimManager::Ptr> simManager; | 1184 | core::Property<SimManager::Ptr> simManager; |
54 | 1179 | 1185 | ||
55 | 1180 | 1186 | ||
56 | === modified file 'src/indicator/modem.cpp' | |||
57 | --- src/indicator/modem.cpp 2014-12-09 10:58:21 +0000 | |||
58 | +++ src/indicator/modem.cpp 2015-01-30 12:31:15 +0000 | |||
59 | @@ -65,20 +65,21 @@ | |||
60 | 65 | }); | 65 | }); |
61 | 66 | }); | 66 | }); |
62 | 67 | 67 | ||
64 | 68 | simManagerChanged(m_ofonoModem->simManager.get()); | 68 | std::unique_lock<std::mutex> lock(m_ofonoModem->_lock); |
65 | 69 | auto simmgr = m_ofonoModem->simManager.get(); | ||
66 | 70 | auto netreg = m_ofonoModem->networkRegistration.get(); | ||
67 | 71 | lock.unlock(); | ||
68 | 72 | |||
69 | 73 | simManagerChanged(simmgr); | ||
70 | 69 | m_ofonoModem->simManager.changed().connect([that](org::ofono::Interface::SimManager::Ptr simmgr) | 74 | m_ofonoModem->simManager.changed().connect([that](org::ofono::Interface::SimManager::Ptr simmgr) |
71 | 70 | { | 75 | { |
75 | 71 | GMainLoopDispatch([that, simmgr](){ | 76 | that->simManagerChanged(simmgr); |
73 | 72 | that->simManagerChanged(simmgr); | ||
74 | 73 | }); | ||
76 | 74 | }); | 77 | }); |
77 | 75 | 78 | ||
79 | 76 | networkRegistrationChanged(m_ofonoModem->networkRegistration.get()); | 79 | networkRegistrationChanged(netreg); |
80 | 77 | m_ofonoModem->networkRegistration.changed().connect([that](org::ofono::Interface::NetworkRegistration::Ptr netreg) | 80 | m_ofonoModem->networkRegistration.changed().connect([that](org::ofono::Interface::NetworkRegistration::Ptr netreg) |
81 | 78 | { | 81 | { |
85 | 79 | GMainLoopDispatch([that, netreg](){ | 82 | that->networkRegistrationChanged(netreg); |
83 | 80 | that->networkRegistrationChanged(netreg); | ||
84 | 81 | }); | ||
86 | 82 | }); | 83 | }); |
87 | 83 | 84 | ||
88 | 84 | /// @todo hook up with system-settings to allow changing the identifier. | 85 | /// @todo hook up with system-settings to allow changing the identifier. |
89 | @@ -93,14 +94,17 @@ | |||
90 | 93 | } else { | 94 | } else { |
91 | 94 | m_simIdentifier.set(path); | 95 | m_simIdentifier.set(path); |
92 | 95 | } | 96 | } |
93 | 96 | |||
94 | 97 | } | 97 | } |
95 | 98 | 98 | ||
96 | 99 | 99 | ||
97 | 100 | void | 100 | void |
98 | 101 | Modem::Private::update() | 101 | Modem::Private::update() |
99 | 102 | { | 102 | { |
100 | 103 | std::unique_lock<std::mutex> lock(m_ofonoModem->_lock); | ||
101 | 103 | auto simmgr = m_ofonoModem->simManager.get(); | 104 | auto simmgr = m_ofonoModem->simManager.get(); |
102 | 105 | auto netreg = m_ofonoModem->networkRegistration.get(); | ||
103 | 106 | lock.unlock(); | ||
104 | 107 | |||
105 | 104 | if (simmgr) { | 108 | if (simmgr) { |
106 | 105 | // update requiredPin | 109 | // update requiredPin |
107 | 106 | switch(simmgr->pinRequired.get()) | 110 | switch(simmgr->pinRequired.get()) |
108 | @@ -155,7 +159,6 @@ | |||
109 | 155 | m_simStatus.set(SimStatus::not_available); | 159 | m_simStatus.set(SimStatus::not_available); |
110 | 156 | } | 160 | } |
111 | 157 | 161 | ||
112 | 158 | auto netreg = m_ofonoModem->networkRegistration.get(); | ||
113 | 159 | if (netreg) { | 162 | if (netreg) { |
114 | 160 | m_operatorName.set(netreg->operatorName.get()); | 163 | m_operatorName.set(netreg->operatorName.get()); |
115 | 161 | m_status.set(netreg->status.get()); | 164 | m_status.set(netreg->status.get()); |
116 | @@ -172,75 +175,55 @@ | |||
117 | 172 | void | 175 | void |
118 | 173 | Modem::Private::networkRegistrationChanged(org::ofono::Interface::NetworkRegistration::Ptr netreg) | 176 | Modem::Private::networkRegistrationChanged(org::ofono::Interface::NetworkRegistration::Ptr netreg) |
119 | 174 | { | 177 | { |
120 | 178 | auto that = shared_from_this(); | ||
121 | 175 | if (netreg) { | 179 | if (netreg) { |
122 | 176 | auto that = shared_from_this(); | ||
123 | 177 | netreg->operatorName.changed().connect([that](const std::string &) | 180 | netreg->operatorName.changed().connect([that](const std::string &) |
124 | 178 | { | 181 | { |
129 | 179 | GMainLoopDispatch([that]() | 182 | GMainLoopDispatch([that]() { that->update(); }); |
126 | 180 | { | ||
127 | 181 | that->update(); | ||
128 | 182 | }); | ||
130 | 183 | }); | 183 | }); |
131 | 184 | netreg->status.changed().connect([that](org::ofono::Interface::NetworkRegistration::Status) | 184 | netreg->status.changed().connect([that](org::ofono::Interface::NetworkRegistration::Status) |
132 | 185 | { | 185 | { |
137 | 186 | GMainLoopDispatch([that]() | 186 | GMainLoopDispatch([that]() { that->update(); }); |
134 | 187 | { | ||
135 | 188 | that->update(); | ||
136 | 189 | }); | ||
138 | 190 | }); | 187 | }); |
139 | 191 | 188 | ||
140 | 192 | netreg->strength.changed().connect([that](std::int8_t) | 189 | netreg->strength.changed().connect([that](std::int8_t) |
141 | 193 | { | 190 | { |
146 | 194 | GMainLoopDispatch([that]() | 191 | GMainLoopDispatch([that]() { that->update(); }); |
143 | 195 | { | ||
144 | 196 | that->update(); | ||
145 | 197 | }); | ||
147 | 198 | }); | 192 | }); |
148 | 199 | 193 | ||
149 | 200 | netreg->technology.changed().connect([that](org::ofono::Interface::NetworkRegistration::Technology) | 194 | netreg->technology.changed().connect([that](org::ofono::Interface::NetworkRegistration::Technology) |
150 | 201 | { | 195 | { |
155 | 202 | GMainLoopDispatch([that]() | 196 | GMainLoopDispatch([that]() { that->update(); }); |
152 | 203 | { | ||
153 | 204 | that->update(); | ||
154 | 205 | }); | ||
156 | 206 | }); | 197 | }); |
157 | 207 | 198 | ||
158 | 208 | } | 199 | } |
160 | 209 | update(); | 200 | |
161 | 201 | GMainLoopDispatch([that]() { that->update(); }); | ||
162 | 210 | } | 202 | } |
163 | 211 | 203 | ||
164 | 212 | 204 | ||
165 | 213 | void | 205 | void |
166 | 214 | Modem::Private::simManagerChanged(org::ofono::Interface::SimManager::Ptr simmgr) | 206 | Modem::Private::simManagerChanged(org::ofono::Interface::SimManager::Ptr simmgr) |
167 | 215 | { | 207 | { |
168 | 208 | auto that = shared_from_this(); | ||
169 | 216 | if (simmgr) { | 209 | if (simmgr) { |
170 | 217 | auto that = shared_from_this(); | ||
171 | 218 | simmgr->present.changed().connect([that](bool) | 210 | simmgr->present.changed().connect([that](bool) |
172 | 219 | { | 211 | { |
177 | 220 | GMainLoopDispatch([that]() | 212 | GMainLoopDispatch([that]() { that->update(); }); |
174 | 221 | { | ||
175 | 222 | that->update(); | ||
176 | 223 | }); | ||
178 | 224 | }); | 213 | }); |
179 | 225 | 214 | ||
180 | 226 | simmgr->pinRequired.changed().connect([that](org::ofono::Interface::SimManager::PinType) | 215 | simmgr->pinRequired.changed().connect([that](org::ofono::Interface::SimManager::PinType) |
181 | 227 | { | 216 | { |
186 | 228 | GMainLoopDispatch([that]() | 217 | GMainLoopDispatch([that]() { that->update(); }); |
183 | 229 | { | ||
184 | 230 | that->update(); | ||
185 | 231 | }); | ||
187 | 232 | }); | 218 | }); |
188 | 233 | 219 | ||
189 | 234 | simmgr->retries.changed().connect([that](std::map<org::ofono::Interface::SimManager::PinType, std::uint8_t>) | 220 | simmgr->retries.changed().connect([that](std::map<org::ofono::Interface::SimManager::PinType, std::uint8_t>) |
190 | 235 | { | 221 | { |
195 | 236 | GMainLoopDispatch([that]() | 222 | GMainLoopDispatch([that]() { that->update(); }); |
192 | 237 | { | ||
193 | 238 | that->update(); | ||
194 | 239 | }); | ||
196 | 240 | }); | 223 | }); |
197 | 241 | 224 | ||
198 | 242 | } | 225 | } |
200 | 243 | update(); | 226 | GMainLoopDispatch([that]() { that->update(); }); |
201 | 244 | } | 227 | } |
202 | 245 | 228 | ||
203 | 246 | Modem::Modem(org::ofono::Interface::Modem::Ptr ofonoModem) | 229 | Modem::Modem(org::ofono::Interface::Modem::Ptr ofonoModem) |
204 | @@ -261,7 +244,11 @@ | |||
205 | 261 | bool | 244 | bool |
206 | 262 | Modem::enterPin(PinType type, const std::string &pin) | 245 | Modem::enterPin(PinType type, const std::string &pin) |
207 | 263 | { | 246 | { |
209 | 264 | if (!d->m_ofonoModem->simManager.get()) { | 247 | std::unique_lock<std::mutex> lock(d->m_ofonoModem->_lock); |
210 | 248 | auto simmgr = d->m_ofonoModem->simManager.get(); | ||
211 | 249 | lock.unlock(); | ||
212 | 250 | |||
213 | 251 | if (!simmgr) { | ||
214 | 265 | throw std::runtime_error(std::string(__PRETTY_FUNCTION__) + ": no simManager."); | 252 | throw std::runtime_error(std::string(__PRETTY_FUNCTION__) + ": no simManager."); |
215 | 266 | } | 253 | } |
216 | 267 | 254 | ||
217 | @@ -269,11 +256,11 @@ | |||
218 | 269 | case PinType::none: | 256 | case PinType::none: |
219 | 270 | return true; | 257 | return true; |
220 | 271 | case PinType::pin: | 258 | case PinType::pin: |
223 | 272 | return d->m_ofonoModem->simManager.get()->enterPin(org::ofono::Interface::SimManager::PinType::pin, | 259 | return simmgr->enterPin(org::ofono::Interface::SimManager::PinType::pin, |
224 | 273 | pin); | 260 | pin); |
225 | 274 | case PinType::puk: | 261 | case PinType::puk: |
228 | 275 | return d->m_ofonoModem->simManager.get()->enterPin(org::ofono::Interface::SimManager::PinType::puk, | 262 | return simmgr->enterPin(org::ofono::Interface::SimManager::PinType::puk, |
229 | 276 | pin); | 263 | pin); |
230 | 277 | break; | 264 | break; |
231 | 278 | } | 265 | } |
232 | 279 | 266 | ||
233 | @@ -284,7 +271,11 @@ | |||
234 | 284 | bool | 271 | bool |
235 | 285 | Modem::resetPin(PinType type, const std::string &puk, const std::string &pin) | 272 | Modem::resetPin(PinType type, const std::string &puk, const std::string &pin) |
236 | 286 | { | 273 | { |
238 | 287 | if (!d->m_ofonoModem->simManager.get()) { | 274 | std::unique_lock<std::mutex> lock(d->m_ofonoModem->_lock); |
239 | 275 | auto simmgr = d->m_ofonoModem->simManager.get(); | ||
240 | 276 | lock.unlock(); | ||
241 | 277 | |||
242 | 278 | if (!simmgr) { | ||
243 | 288 | throw std::runtime_error(std::string(__PRETTY_FUNCTION__) + ": no simManager."); | 279 | throw std::runtime_error(std::string(__PRETTY_FUNCTION__) + ": no simManager."); |
244 | 289 | } | 280 | } |
245 | 290 | 281 | ||
246 | @@ -292,9 +283,9 @@ | |||
247 | 292 | case PinType::none: | 283 | case PinType::none: |
248 | 293 | return true; | 284 | return true; |
249 | 294 | case PinType::puk: | 285 | case PinType::puk: |
253 | 295 | return d->m_ofonoModem->simManager.get()->resetPin(org::ofono::Interface::SimManager::PinType::puk, | 286 | return simmgr->resetPin(org::ofono::Interface::SimManager::PinType::puk, |
254 | 296 | puk, | 287 | puk, |
255 | 297 | pin); | 288 | pin); |
256 | 298 | default: | 289 | default: |
257 | 299 | throw std::runtime_error(std::string(__PRETTY_FUNCTION__) + ": Not Supported."); | 290 | throw std::runtime_error(std::string(__PRETTY_FUNCTION__) + ": Not Supported."); |
258 | 300 | } | 291 | } |
259 | @@ -303,7 +294,11 @@ | |||
260 | 303 | bool | 294 | bool |
261 | 304 | Modem::changePin(PinType type, const std::string &oldPin, const std::string &newPin) | 295 | Modem::changePin(PinType type, const std::string &oldPin, const std::string &newPin) |
262 | 305 | { | 296 | { |
264 | 306 | if (!d->m_ofonoModem->simManager.get()) { | 297 | std::unique_lock<std::mutex> lock(d->m_ofonoModem->_lock); |
265 | 298 | auto simmgr = d->m_ofonoModem->simManager.get(); | ||
266 | 299 | lock.unlock(); | ||
267 | 300 | |||
268 | 301 | if (!simmgr) { | ||
269 | 307 | throw std::runtime_error(std::string(__PRETTY_FUNCTION__) + ": no simManager."); | 302 | throw std::runtime_error(std::string(__PRETTY_FUNCTION__) + ": no simManager."); |
270 | 308 | } | 303 | } |
271 | 309 | 304 | ||
272 | @@ -311,13 +306,13 @@ | |||
273 | 311 | case PinType::none: | 306 | case PinType::none: |
274 | 312 | return true; | 307 | return true; |
275 | 313 | case PinType::pin: | 308 | case PinType::pin: |
279 | 314 | return d->m_ofonoModem->simManager.get()->changePin(org::ofono::Interface::SimManager::PinType::pin, | 309 | return simmgr->changePin(org::ofono::Interface::SimManager::PinType::pin, |
280 | 315 | oldPin, | 310 | oldPin, |
281 | 316 | newPin); | 311 | newPin); |
282 | 317 | case PinType::puk: | 312 | case PinType::puk: |
286 | 318 | return d->m_ofonoModem->simManager.get()->changePin(org::ofono::Interface::SimManager::PinType::puk, | 313 | return simmgr->changePin(org::ofono::Interface::SimManager::PinType::puk, |
287 | 319 | oldPin, | 314 | oldPin, |
288 | 320 | newPin); | 315 | newPin); |
289 | 321 | break; | 316 | break; |
290 | 322 | } | 317 | } |
291 | 323 | 318 | ||
292 | 324 | 319 | ||
293 | === modified file 'src/menumodel-cpp/gio-helpers/util.cpp' | |||
294 | --- src/menumodel-cpp/gio-helpers/util.cpp 2014-12-09 14:56:21 +0000 | |||
295 | +++ src/menumodel-cpp/gio-helpers/util.cpp 2015-01-30 12:31:15 +0000 | |||
296 | @@ -19,43 +19,40 @@ | |||
297 | 19 | 19 | ||
298 | 20 | #include "util.h" | 20 | #include "util.h" |
299 | 21 | 21 | ||
300 | 22 | // guards access to __funcs | ||
301 | 22 | std::mutex GMainLoopDispatch::_lock; | 23 | std::mutex GMainLoopDispatch::_lock; |
303 | 23 | std::list<GMainLoopDispatch::Func *> GMainLoopDispatch::_funcs; | 24 | std::list<GMainLoopDispatch::Func> GMainLoopDispatch::__funcs; |
304 | 24 | 25 | ||
305 | 25 | gboolean | 26 | gboolean |
306 | 26 | GMainLoopDispatch::dispatch_cb(gpointer) | 27 | GMainLoopDispatch::dispatch_cb(gpointer) |
307 | 27 | { | 28 | { |
308 | 28 | std::unique_lock<std::mutex> lock(_lock); | 29 | std::unique_lock<std::mutex> lock(_lock); |
314 | 29 | for (auto func : _funcs) { | 30 | auto funcs = __funcs; |
315 | 30 | lock.unlock(); | 31 | __funcs.clear(); |
316 | 31 | (*func)(); | 32 | lock.unlock(); |
317 | 32 | lock.lock(); | 33 | |
318 | 33 | delete func; | 34 | for (auto &func : funcs) { |
319 | 35 | func(); | ||
320 | 34 | } | 36 | } |
321 | 35 | _funcs.clear(); | ||
322 | 36 | return G_SOURCE_REMOVE; | 37 | return G_SOURCE_REMOVE; |
323 | 37 | } | 38 | } |
324 | 38 | 39 | ||
325 | 39 | GMainLoopDispatch::GMainLoopDispatch(Func func, int priority, bool force_delayed) | 40 | GMainLoopDispatch::GMainLoopDispatch(Func func, int priority, bool force_delayed) |
326 | 40 | { | 41 | { |
327 | 41 | std::unique_lock<std::mutex> lock(_lock); | ||
328 | 42 | |||
329 | 43 | if (!force_delayed && | 42 | if (!force_delayed && |
330 | 44 | g_main_context_acquire(g_main_context_default())) { | 43 | g_main_context_acquire(g_main_context_default())) { |
334 | 45 | // already running inside GMainLoop.. | 44 | // already running inside GMainLoop. |
332 | 46 | // free the lock and dispatch immediately. | ||
333 | 47 | lock.unlock(); | ||
335 | 48 | func(); | 45 | func(); |
336 | 49 | g_main_context_release(g_main_context_default()); | 46 | g_main_context_release(g_main_context_default()); |
337 | 50 | } else { | 47 | } else { |
340 | 51 | std::function<void()> *funcPtr = new std::function<void()>(func); | 48 | std::unique_lock<std::mutex> lock(_lock); |
341 | 52 | if (_funcs.empty()) { | 49 | if (__funcs.empty()) { |
342 | 53 | g_idle_add_full(priority, | 50 | g_idle_add_full(priority, |
343 | 54 | GSourceFunc(GMainLoopDispatch::dispatch_cb), | 51 | GSourceFunc(GMainLoopDispatch::dispatch_cb), |
344 | 55 | NULL, | 52 | NULL, |
345 | 56 | NULL); | 53 | NULL); |
346 | 57 | } | 54 | } |
348 | 58 | _funcs.push_back(funcPtr); | 55 | __funcs.push_back(func); |
349 | 59 | } | 56 | } |
350 | 60 | } | 57 | } |
351 | 61 | 58 | ||
352 | 62 | 59 | ||
353 | === modified file 'src/menumodel-cpp/gio-helpers/util.h' | |||
354 | --- src/menumodel-cpp/gio-helpers/util.h 2014-12-09 14:56:21 +0000 | |||
355 | +++ src/menumodel-cpp/gio-helpers/util.h 2015-01-30 12:31:15 +0000 | |||
356 | @@ -74,7 +74,7 @@ | |||
357 | 74 | typedef std::function<void()> Func; | 74 | typedef std::function<void()> Func; |
358 | 75 | static std::mutex _lock; | 75 | static std::mutex _lock; |
359 | 76 | // list keeps the order of the functions | 76 | // list keeps the order of the functions |
361 | 77 | static std::list<Func *> _funcs; | 77 | static std::list<Func> __funcs; |
362 | 78 | 78 | ||
363 | 79 | //GMainLoopDispatch() = delete; | 79 | //GMainLoopDispatch() = delete; |
364 | 80 | GMainLoopDispatch(Func func, int priority=G_PRIORITY_HIGH, bool force_delayed=false); | 80 | GMainLoopDispatch(Func func, int priority=G_PRIORITY_HIGH, bool force_delayed=false); |
14.09 approved