Page MenuHomeWildfire Games

Fix possible memory leaks.
AbandonedPublic

Authored by leper on May 4 2017, 1:30 AM.

Details

Reviewers
vladislavbelov
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Summary

These were either pointed out by GCC6, cppcheck, or Clang's scan-build.
Dunno which one, maybe the second.

Test Plan

Check that there isn't some wxWidgets magic going on that takes ownership of those and does the cleanup.

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
warning_fixes
Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 1426
Build 2249: Vulcan BuildJenkins
Build 2248: arc lint + arc unit

Event Timeline

leper created this revision.May 4 2017, 1:30 AM
Vulcan added a subscriber: Vulcan.May 4 2017, 10:33 AM

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!

http://jw:8080/job/phabricator/990/ for more details.

Deleting of undefined pointer is UB, I think. So see the inline comment.

source/tools/atlas/AtlasUI/ScenarioEditor/SectionLayout.cpp
250

Add:

SectionLayout::SectionLayout()
    : m_HorizSplitter(nullptr), m_VertSplitter(nullptr), m_SidebarBook(nullptr)
{
}
vladislavbelov requested changes to this revision.May 4 2017, 11:57 AM
This revision now requires changes to proceed.May 4 2017, 11:57 AM
leper abandoned this revision.May 8 2017, 4:54 AM

Actually all those created objects inherit from some wxThing, so the parent of those is responsible for cleaning this up. I knew I should have checked that again before submitting this, ah well.