Skip to content

Commit

Permalink
Geometry extensions: remove unnecessary smart pointer deletion
Browse files Browse the repository at this point in the history
==============================================================

When the geometry object is destroyed, std::vector's destructor is called, which in turn calls the destructor of the smart pointers.

If a weak_ptr corresponding to one of those shared_ptr is locked (elsewhere, if FC were multithread),
the underlaying resource will not be freed until said locked weak_ptr goes out of scope. It will then.
  • Loading branch information
abdullahtahiriyo authored and wwmayer committed Jul 14, 2019
1 parent b5f5d1c commit 460bb59
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Mod/Part/App/Geometry.cpp
Expand Up @@ -192,8 +192,7 @@ Geometry::Geometry()

Geometry::~Geometry()
{
for(std::vector<std::shared_ptr<GeometryExtension>>::iterator it = extensions.begin(); it != extensions.end(); it++)
(*it).reset();

}

// Persistence implementer
Expand Down

0 comments on commit 460bb59

Please sign in to comment.