Only create NotificationPresenter when succeeded to initailize toast manager
This fix crash when we failed to initailize toast manager.
This commit is contained in:
parent
2468c7c34e
commit
c060539562
3 changed files with 35 additions and 16 deletions
|
@ -27,7 +27,10 @@ void RemoveNotification(base::WeakPtr<WindowsToastNotification> notification) {
|
|||
|
||||
// static
|
||||
NotificationPresenter* NotificationPresenter::Create() {
|
||||
return new NotificationPresenterWin;
|
||||
if (WindowsToastNotification::Initialize())
|
||||
return new NotificationPresenterWin;
|
||||
else
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
NotificationPresenterWin::NotificationPresenterWin() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue