| 306 | } |
| 307 | |
| 308 | void |
| 309 | FrameworkPrivate::Shutdown0(bool restart, bool wasActive) |
| 310 | { |
| 311 | try |
| 312 | { |
| 313 | { |
| 314 | auto l = Lock(); |
| 315 | US_UNUSED(l); |
| 316 | operation = OP_DEACTIVATING; |
| 317 | state = Bundle::STATE_STOPPING; |
| 318 | } |
| 319 | coreCtx->listeners.BundleChanged( |
| 320 | BundleEvent(BundleEvent::BUNDLE_STOPPING, MakeBundle(this->shared_from_this()))); |
| 321 | |
| 322 | coreCtx->SetFrameworkStoppedState(true); |
| 323 | |
| 324 | if (wasActive) |
| 325 | { |
| 326 | StopAllBundles(); |
| 327 | } |
| 328 | coreCtx->Uninit0(); |
| 329 | |
| 330 | { |
| 331 | auto l = Lock(); |
| 332 | US_UNUSED(l); |
| 333 | coreCtx->Uninit1(); |
| 334 | ShutdownDone_unlocked(restart); |
| 335 | } |
| 336 | if (restart) |
| 337 | { |
| 338 | if (wasActive) |
| 339 | { |
| 340 | Start(0); |
| 341 | } |
| 342 | else |
| 343 | { |
| 344 | Init(); |
| 345 | } |
| 346 | } |
| 347 | } |
| 348 | catch (...) |
| 349 | { |
| 350 | auto l = Lock(); |
| 351 | US_UNUSED(l); |
| 352 | SystemShuttingdownDone_unlocked(FrameworkEventInternal { true, |
| 353 | FrameworkEvent::Type::FRAMEWORK_ERROR, |
| 354 | std::string(), |
| 355 | std::current_exception() }); |
| 356 | } |
| 357 | } |
| 358 | |
| 359 | void |
| 360 | FrameworkPrivate::ShutdownDone_unlocked(bool restart) |
nothing calls this directly
no test coverage detected