diff --git a/lib/processImage.js b/lib/processImage.js
index <HASH>..<HASH> 100644
--- a/lib/processImage.js
+++ b/lib/processImage.js
@@ -175,15 +175,14 @@ module.exports = options => {
 
           function startProcessing(optionalFirstChunk) {
             let hasEnded = false;
-
             let cleanedUp = false;
 
             function cleanUp(doNotDestroyHijacked) {
-              if (!doNotDestroyHijacked) {
-                res.destroyHijacked();
-              }
-
               if (!cleanedUp) {
+                if (!doNotDestroyHijacked) {
+                  res.destroyHijacked();
+                }
+
                 cleanedUp = true;
 
                 res.removeAllListeners();
Protect everything in the cleanUp() function with the flag.