Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
KMix
Commits
09aabd4a
Commit
09aabd4a
authored
Jan 02, 2013
by
Christian Esken
Browse files
Fix the ProfControl memory leak in ViewDockAreaPopup
CCBUGS: 309464
parent
2b01a16a
Changes
2
Hide whitespace changes
Inline
Side-by-side
gui/viewdockareapopup.cpp
View file @
09aabd4a
...
...
@@ -49,6 +49,10 @@
// Restore volume button feature is incomplete => disabling for KDE 4.10
#undef RESTORE_VOLUME_BUTTON
QString
ViewDockAreaPopup
::
InternedString_Star
=
QString
(
"*"
);
QString
ViewDockAreaPopup
::
InternedString_Subcontrols
=
QString
(
"pvolume,cvolume,pswitch,cswitch"
);
ProfControl
ViewDockAreaPopup
::
MatchAllForSoundMenu
=
ProfControl
(
ViewDockAreaPopup
::
InternedString_Star
,
ViewDockAreaPopup
::
InternedString_Subcontrols
);
ViewDockAreaPopup
::
ViewDockAreaPopup
(
QWidget
*
parent
,
QString
id
,
ViewBase
::
ViewFlags
vflags
,
QString
guiProfileId
,
KMixWindow
*
dockW
)
:
ViewBase
(
parent
,
id
,
0
,
vflags
,
guiProfileId
),
_dock
(
dockW
)
...
...
@@ -265,22 +269,25 @@ Application: KMix (kmix), signal: Segmentation fault
// Add all application streams
foreach
(
Mixer
*
mixer2
,
_mixers
)
{
kDebug
(
67100
)
<<
"Add mixer to tray popup? "
<<
mixer2
->
id
();
foreach
(
shared_ptr
<
MixDevice
>
md
,
mixer2
->
getMixSet
()
)
{
kDebug
(
67100
)
<<
"Add to tray popup? "
<<
md
->
id
();
if
(
md
->
isApplicationStream
())
{
_mixSet
.
append
(
md
);
kDebug
(
67100
)
<<
"Add to tray popup: "
<<
md
->
id
();
kDebug
(
67100
)
<<
"Add to tray popup
! YES
: "
<<
md
->
id
();
}
}
}
}
QWidget
*
ViewDockAreaPopup
::
add
(
shared_ptr
<
MixDevice
>
md
)
{
bool
vertical
=
(
GlobalConfig
::
instance
().
traypopupOrientation
==
Qt
::
Vertical
);
// I am wondering whether using vflags for this would still make sense
/*
QString dummyMatchAll("*");
QString matchAllPlaybackAndTheCswitch("pvolume,cvolume,pswitch,cswitch");
// Leak | relevant | pctl Each time a stream is added, a new ProfControl gets created.
...
...
@@ -290,6 +297,7 @@ QWidget* ViewDockAreaPopup::add(shared_ptr<MixDevice> md)
// Summarizing: ProfControl* is either owned by the GUIProfile or created new (ownership unclear).
// Hint: dummyMatchAll and matchAllPlaybackAndTheCswitch leak together with pctl
ProfControl *pctl = new ProfControl( dummyMatchAll, matchAllPlaybackAndTheCswitch);
*/
if
(
!
md
->
isApplicationStream
()
)
{
...
...
@@ -312,6 +320,7 @@ _layoutMDW->addWidget( seperatorBetweenMastersAndStreams, row, col );
//_layoutMDW->addItem( new QSpacerItem( 5, 5 ), row, col );
}
ProfControl
*
pctl
=
&
MatchAllForSoundMenu
;
MixDeviceWidget
*
mdw
=
new
MDWSlider
(
md
,
// only 1 device.
true
,
// Show Mute LE
...
...
gui/viewdockareapopup.h
View file @
09aabd4a
...
...
@@ -69,6 +69,10 @@ private:
QPushButton
*
restoreVolumeButton4
;
KIcon
*
restoreVolumeIcon
;
static
ProfControl
MatchAllForSoundMenu
;
static
QString
InternedString_Star
;
static
QString
InternedString_Subcontrols
;
public
slots
:
void
controlsChange
(
int
changeType
);
virtual
void
configureView
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment