summaryrefslogtreecommitdiff
path: root/dmagick/ImageView.d
diff options
context:
space:
mode:
authorMike Wey2012-04-09 14:35:41 +0200
committerMike Wey2012-04-09 14:35:41 +0200
commit811e5806d29c0856b182c278ec544a7fe4be4175 (patch)
tree051e33ec2af526c070b982f01cd59b5ba2ae6931 /dmagick/ImageView.d
parent90958a9bc18b13cb76581eea7ab7d99b8d831601 (diff)
Don't try to use the D GC when creating blobs.
This causes segfaults, see issue #4.
Diffstat (limited to 'dmagick/ImageView.d')
-rw-r--r--dmagick/ImageView.d6
1 files changed, 4 insertions, 2 deletions
diff --git a/dmagick/ImageView.d b/dmagick/ImageView.d
index d464588..21e4e46 100644
--- a/dmagick/ImageView.d
+++ b/dmagick/ImageView.d
@@ -157,13 +157,15 @@ class ImageView
* Support the usage of foreach to loop over the rows in the view.
* The foreach is executed in parallel.
*/
- int opApply(int delegate(Pixels) dg)
+ int opApply(int delegate(ref Pixels) dg)
{
shared(int) progress;
foreach ( row; taskPool.parallel(iota(extent.y, extent.y + extent.height)) )
{
- int result = dg(Pixels(image, extent.x, row, extent.width, 1));
+ Pixels pixels = Pixels(image, extent.x, row, extent.width, 1);
+
+ int result = dg(pixels);
if ( result )
return result;