Fix crash in SystemMediaControls init.
This commit is contained in:
parent
df5baba86b
commit
0f234188e1
|
@ -148,9 +148,6 @@ Application::Application(not_null<Launcher*> launcher)
|
|||
, _audio(std::make_unique<Media::Audio::Instance>())
|
||||
, _fallbackProductionConfig(
|
||||
std::make_unique<MTP::Config>(MTP::Environment::Production))
|
||||
, _mediaControlsManager(MediaControlsManager::Supported()
|
||||
? std::make_unique<MediaControlsManager>()
|
||||
: nullptr)
|
||||
, _downloadManager(std::make_unique<Data::DownloadManager>())
|
||||
, _domain(std::make_unique<Main::Domain>(cDataFile()))
|
||||
, _exportManager(std::make_unique<Export::Manager>())
|
||||
|
@ -216,6 +213,8 @@ Application::~Application() {
|
|||
|
||||
Window::Theme::Uninitialize();
|
||||
|
||||
_mediaControlsManager = nullptr;
|
||||
|
||||
Media::Player::finish(_audio.get());
|
||||
style::stopManager();
|
||||
|
||||
|
@ -267,6 +266,10 @@ void Application::run() {
|
|||
startSystemDarkModeViewer();
|
||||
Media::Player::start(_audio.get());
|
||||
|
||||
if (MediaControlsManager::Supported()) {
|
||||
_mediaControlsManager = std::make_unique<MediaControlsManager>();
|
||||
}
|
||||
|
||||
style::ShortAnimationPlaying(
|
||||
) | rpl::start_with_next([=](bool playing) {
|
||||
if (playing) {
|
||||
|
|
|
@ -387,7 +387,7 @@ private:
|
|||
std::unique_ptr<Window::Notifications::System> _notifications;
|
||||
|
||||
using MediaControlsManager = Media::SystemMediaControlsManager;
|
||||
const std::unique_ptr<MediaControlsManager> _mediaControlsManager;
|
||||
std::unique_ptr<MediaControlsManager> _mediaControlsManager;
|
||||
const std::unique_ptr<Data::DownloadManager> _downloadManager;
|
||||
const std::unique_ptr<Main::Domain> _domain;
|
||||
const std::unique_ptr<Export::Manager> _exportManager;
|
||||
|
|
|
@ -765,6 +765,7 @@ auto Media::Player::Instance::seekingChanges(AudioMsgId::Type type) const
|
|||
|
||||
not_null<Instance*> instance() {
|
||||
Expects(SingleInstance != nullptr);
|
||||
|
||||
return SingleInstance;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue