summaryrefslogtreecommitdiff
path: root/Magick++
diff options
context:
space:
mode:
authordirk <dirk@git.imagemagick.org>2015-02-21 06:51:10 +0000
committerdirk <dirk@git.imagemagick.org>2015-02-21 06:51:10 +0000
commit4b39a1ba9e9e98ae9847be7f1dee1034eab7076f (patch)
tree38dc9e397b8fc45dc2f1142bf583399d3bba67b4 /Magick++
parent176d1cd4293e7b83399eb0fb74e4622a476ef7c3 (diff)
downloadImageMagick-4b39a1ba9e9e98ae9847be7f1dee1034eab7076f.tar.gz
Renamed property of ImageRef
Diffstat (limited to 'Magick++')
-rw-r--r--Magick++/lib/Image.cpp16
-rw-r--r--Magick++/lib/ImageRef.cpp8
-rw-r--r--Magick++/lib/Magick++/ImageRef.h8
3 files changed, 16 insertions, 16 deletions
diff --git a/Magick++/lib/Image.cpp b/Magick++/lib/Image.cpp
index c0fed82b4..436b07135 100644
--- a/Magick++/lib/Image.cpp
+++ b/Magick++/lib/Image.cpp
@@ -4821,7 +4821,7 @@ const MagickCore::QuantizeInfo *Magick::Image::constQuantizeInfo(void) const
void Magick::Image::modifyImage(void)
{
- if (_imgRef->isOwner())
+ if (!_imgRef->isShared())
return;
GetPPException;
@@ -4844,14 +4844,14 @@ MagickCore::Image *Magick::Image::replaceImage(MagickCore::Image *replacement_)
}
// We can replace the image if we own it.
- if (!_imgRef->replaceImage(image))
- {
- // We don't own the image, dereference and replace with new reference
- if (_imgRef->decrease() == 0)
- delete _imgRef;
+ if (_imgRef->replaceImage(image))
+ return(image);
- _imgRef=new ImageRef(image,constOptions());
- }
+ // We don't own the image, dereference and replace with new reference
+ if (_imgRef->decrease() == 0)
+ delete _imgRef;
+
+ _imgRef=new ImageRef(image,constOptions());
return(image);
}
diff --git a/Magick++/lib/ImageRef.cpp b/Magick++/lib/ImageRef.cpp
index c8b7b1936..6a32a616e 100644
--- a/Magick++/lib/ImageRef.cpp
+++ b/Magick++/lib/ImageRef.cpp
@@ -83,15 +83,15 @@ void Magick::ImageRef::increase()
_mutexLock.unlock();
}
-bool Magick::ImageRef::isOwner()
+bool Magick::ImageRef::isShared()
{
bool
- isOwner;
+ isShared;
_mutexLock.lock();
- isOwner=(_refCount == 1);
+ isShared=(_refCount > 1);
_mutexLock.unlock();
- return(isOwner);
+ return(isShared);
}
void Magick::ImageRef::options(Magick::Options *options_)
diff --git a/Magick++/lib/Magick++/ImageRef.h b/Magick++/lib/Magick++/ImageRef.h
index d6fb79fc8..6541f0fbe 100644
--- a/Magick++/lib/Magick++/ImageRef.h
+++ b/Magick++/lib/Magick++/ImageRef.h
@@ -48,15 +48,15 @@ namespace Magick
// Increases reference count
void increase();
- // Returns true if the reference count is one
- bool isOwner();
+ // Returns true if the reference count is more than one
+ bool isShared();
// Retrieve Options from reference
void options(Options *options_);
Options *options(void);
- // Tries to replaces the images with the specified image, returns fails
- // when this fails
+ // Tries to replaces the images with the specified image, returns
+ // false when current the image is shared
bool replaceImage(MagickCore::Image *replacement_);
// Image signature. Set force_ to true in order to re-calculate