Fixed memory leak in new_argv
Needs RevisionPublic

Authored by nathanhenry on Dec 9 2017, 4:18 PM.

Details

Reviewers
davidedmundson
Summary

Fixed memory leak in oldCorr

Fixed memory leak

Fixed memory leak

Diff Detail

Repository
R119 Plasma Desktop
Branch
Memory-Leak-Fixes
Lint
No Linters Available
Unit
No Unit Test Coverage
nathanhenry created this revision.Dec 9 2017, 4:18 PM
Restricted Application added a project: Plasma. · View Herald TranscriptDec 9 2017, 4:18 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
nathanhenry requested review of this revision.Dec 9 2017, 4:18 PM
nathanhenry updated this revision to Diff 23692.Dec 9 2017, 4:27 PM

Forgot to remove debug statement

davidedmundson added inline comments.
kcms/kfontinst/apps/Viewer.cpp
141–144

that can't be right.

kcms/runners/kcm.cpp
83–85 ↗(On Diff #23692)
  1. this doesn't leak
  1. what's the point of making a manager?
anthonyfieroni added inline comments.
applets/kimpanel/backend/scim/main.cpp
1091–1092

Remove all references to them, they are unused.

kcms/kfontinst/apps/Viewer.cpp
146

Wrong indentation.

davidedmundson requested changes to this revision.Dec 11 2017, 12:17 PM
This revision now requires changes to proceed.Dec 11 2017, 12:17 PM
nathanhenry added inline comments.Dec 12 2017, 9:48 PM
kcms/kfontinst/apps/Viewer.cpp
141–144

More info?

kcms/runners/kcm.cpp
83–85 ↗(On Diff #23692)

How doesn't this leak when excluding my change?

Fixed indentation and removed new_argv and new_argc

nathanhenry marked 2 inline comments as done.Dec 12 2017, 9:53 PM
davidedmundson added inline comments.Dec 12 2017, 9:56 PM
kcms/kfontinst/apps/Viewer.cpp
141–144

you're deleting an object immediately after show.

That will close the dialog

145

and then it will crash here.

kcms/runners/kcm.cpp
83–85 ↗(On Diff #23692)

The runner manager has a parent object.

http://doc.qt.io/qt-5/objecttrees.html

nathanhenry added inline comments.Dec 12 2017, 10:31 PM
kcms/kfontinst/apps/Viewer.cpp
145

Should this be dereferenced outside the loop or not at all?

kcms/runners/kcm.cpp
83–85 ↗(On Diff #23692)

Thanks

kcms/hardware/joystick/joydevice.cpp
197

When you do this origCorr is now a dangling pointer to deleted contents.

kcms/kfontinst/apps/Viewer.cpp
145

personally I'd solve this with

view->setAttribute(Qt::WA_DeleteOnClose)

and then this method can just create objects and not worry about destroying them itself.

kcms/standard_actions/standard_actions_module.cpp
137

We've just passed this to
m_editor->addCollection(m_actionCollection,
in the line above...I expect we still need our actionCollection.

Please make sure you test your changes before posting them.

Fixed m_actionCollection, manager and solved viewer

anthonyfieroni added inline comments.Dec 13 2017, 5:21 AM
kcms/kfontinst/apps/Viewer.cpp
143

You should set attribute delete on close as well.

kcms/standard_actions/standard_actions_module.cpp
136

unrelated

davidedmundson requested changes to this revision.Nov 29 2018, 2:03 PM

Many changes remaining - especially in joystick, I'm pretty sure that'll crash.

Marking as request changes

This revision now requires changes to proceed.Nov 29 2018, 2:03 PM
ngraham added a subscriber: ngraham.Jan 2 2019, 8:26 PM

What's the status of this? @nathanhenry are you planning to revive it and address the remaining concerns?