Skip to content
Snippets Groups Projects
Commit 4d1dd952 authored by Markus Blatt's avatar Markus Blatt
Browse files

[BugFix] Copy rep_ member of SharedCounterImpl during copy constructor...

[BugFix] Copy rep_ member of SharedCounterImpl during copy constructor (otherwise the deleter might work on a unitialized pointer).

[[Imported from SVN: r7420]]
parent a3906ad6
No related branches found
No related tags found
No related merge requests found
......@@ -186,12 +186,12 @@ namespace Dune
/** @brief Constructor from existing Pointer with custom deleter. */
SharedCountImpl(T* elem,const Deleter& deleter) :
SharedCount(),
rep_(elem),
deleter_(deleter)
deleter_(deleter),
rep_(elem)
{}
/** @brief Copy constructor with type conversion. */
SharedCountImpl(const SharedCountImpl& rep)
: SharedCount(rep), deleter_(rep.deleter_) {}
: SharedCount(rep), deleter_(rep.deleter_), rep_(rep.rep_) {}
/** @brief Destructor, deletes element_type* rep_ using deleter. */
~SharedCountImpl()
{ deleter_(rep_); }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment