summaryrefslogtreecommitdiffstats
path: root/347.patch
blob: b090b1e3655b8b56a7eb464dd25f1205f0f5793c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 960409cb784cd5d8c9f41068a54dad8141fdf25d Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Fri, 4 Sep 2020 08:57:24 +0200
Subject: [PATCH] thread limit per request

---
 imagick.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/imagick.c b/imagick.c
index 1e6d174..8d0a7b5 100644
--- a/imagick.c
+++ b/imagick.c
@@ -3872,10 +3872,6 @@ PHP_MINIT_FUNCTION(imagick)
 		checkImagickVersion();
 	}
 
-	if (IMAGICK_G(set_single_thread)) {
-		MagickSetResourceLimit(ThreadResource, 1);
-	}
-
 	return SUCCESS;
 }
 
@@ -3981,6 +3977,11 @@ PHP_RINIT_FUNCTION(imagick)
 	(void)module_number;
 
 	IMAGICK_G(progress_callback) = NULL;
+
+	if (IMAGICK_G(set_single_thread)) {
+		MagickSetResourceLimit(ThreadResource, 1);
+	}
+
 	return SUCCESS;
 }