Don't leak the taskbar object, reuse it instead
This commit is contained in:
parent
903a5b5100
commit
8357a33d81
1 changed files with 4 additions and 0 deletions
|
@ -204,10 +204,14 @@ bool TaskbarHost::HandleThumbarButtonEvent(int button_id) {
|
|||
}
|
||||
|
||||
bool TaskbarHost::InitializeTaskbar() {
|
||||
if (taskbar_)
|
||||
return true;
|
||||
|
||||
if (FAILED(::CoCreateInstance(CLSID_TaskbarList, nullptr,
|
||||
CLSCTX_INPROC_SERVER,
|
||||
IID_PPV_ARGS(&taskbar_))) ||
|
||||
FAILED(taskbar_->HrInit())) {
|
||||
taskbar_.Reset();
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
|
|
Loading…
Add table
Reference in a new issue