From 8f8144c50993c4043d5b08ab9881e017e392d064 Mon Sep 17 00:00:00 2001 From: Mike Wey Date: Sun, 30 Jan 2011 20:47:20 +0100 Subject: Add the pattern porperties to Options and a few bug fixes --- dmagick/Utils.d | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'dmagick/Utils.d') diff --git a/dmagick/Utils.d b/dmagick/Utils.d index e8cef21..1396ddf 100644 --- a/dmagick/Utils.d +++ b/dmagick/Utils.d @@ -18,7 +18,7 @@ import dmagick.c.magickType; * Copy a string into a static array used * by ImageMagick for some atributes. */ -private void copyString(ref char[MaxTextExtent] dest, string source) +void copyString(ref char[MaxTextExtent] dest, string source) { if ( source.length < MaxTextExtent ) throw new Exception("text is to long"); //TODO: a proper exception. @@ -34,7 +34,7 @@ private void copyString(ref char[MaxTextExtent] dest, string source) * append a \0 to the end of the string, and the realocation * whould be wastefull if we are just going to copy it */ -private void copyString(ref char* dest, string source) +void copyString(ref char* dest, string source) { if ( source is null ) { @@ -93,6 +93,9 @@ struct RefCounted(alias pred, T) ~this() { + if ( !isInitialized ) + return; + (*refcount)--; if ( *refcount == 0 ) -- cgit v1.2.3