Fix memory leak in Appmenu when using compact menu
ClosedPublic

Authored by davidedmundson on Feb 1 2017, 1:37 PM.

Details

Summary

::createMenu sometimes creates a new menu, sometimes returns a pointer
to a menu from libdbusmenu that we shouldn't delete.

This patch makes any newly created menu delete itself on closure.

It then shuffles some code so that we only call createMenu after
doing checks.

Test Plan

Ran in compact mode, clicked menu a few times
Ran in full mode, clicked a menu a few times

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidedmundson retitled this revision from to Fix memory leak in Appmenu when using compact menu.
davidedmundson updated this object.
davidedmundson edited the test plan for this revision. (Show Details)
davidedmundson added a reviewer: Plasma.
Restricted Application added a project: Plasma. · View Herald TranscriptFeb 1 2017, 1:37 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik accepted this revision.Feb 1 2017, 4:08 PM
broulik added a reviewer: broulik.
This revision is now accepted and ready to land.Feb 1 2017, 4:08 PM
This revision was automatically updated to reflect the committed changes.