mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-25 02:06:04 +02:00
fix assignment operator
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
#include "Poco/DirectoryIterator.h"
|
#include "Poco/DirectoryIterator.h"
|
||||||
|
|
||||||
|
|
||||||
#if defined(POCO_OS_FAMILY_WINDOWS)
|
#if defined(POCO_OS_FAMILY_WINDOWS)
|
||||||
#include "DirectoryIterator_WIN32U.cpp"
|
#include "DirectoryIterator_WIN32U.cpp"
|
||||||
#elif defined(POCO_OS_FAMILY_UNIX)
|
#elif defined(POCO_OS_FAMILY_UNIX)
|
||||||
#include "DirectoryIterator_UNIX.cpp"
|
#include "DirectoryIterator_UNIX.cpp"
|
||||||
@@ -72,13 +72,16 @@ DirectoryIterator::~DirectoryIterator()
|
|||||||
|
|
||||||
DirectoryIterator& DirectoryIterator::operator = (const DirectoryIterator& it)
|
DirectoryIterator& DirectoryIterator::operator = (const DirectoryIterator& it)
|
||||||
{
|
{
|
||||||
if (_pImpl) _pImpl->release();
|
if (&it != this)
|
||||||
_pImpl = it._pImpl;
|
|
||||||
if (_pImpl)
|
|
||||||
{
|
{
|
||||||
_pImpl->duplicate();
|
if (_pImpl) _pImpl->release();
|
||||||
_path = it._path;
|
_pImpl = it._pImpl;
|
||||||
_file = _path;
|
if (_pImpl)
|
||||||
|
{
|
||||||
|
_pImpl->duplicate();
|
||||||
|
_path = it._path;
|
||||||
|
_file = _path;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user