Skip to content

Commit

Permalink
Merge pull request quarkusio#14700 from gsmet/resteasy-imageio-leak
Browse files Browse the repository at this point in the history
Fix RESTEasy ImageIO leak
  • Loading branch information
gsmet authored Feb 1, 2021
2 parents 8f6aece + 6bc2db0 commit 515ca8a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@
import java.io.OutputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;

import javax.imageio.IIOImage;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;

import org.jboss.resteasy.spi.AsyncOutputStream;

import com.oracle.svm.core.annotate.Substitute;
import com.oracle.svm.core.annotate.TargetClass;

Expand Down Expand Up @@ -38,4 +42,11 @@ public void writeTo(IIOImage iioImage, Class<?> type, Type genericType, Annotati
MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException {

}

@Substitute
public CompletionStage<Void> asyncWriteTo(IIOImage t, Class<?> type, Type genericType, Annotation[] annotations,
MediaType mediaType, MultivaluedMap<String, Object> httpHeaders,
AsyncOutputStream entityStream) {
return CompletableFuture.completedFuture(null);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package io.quarkus.resteasy.common.runtime.graal;

import com.oracle.svm.core.annotate.Delete;

@Delete("org.jboss.resteasy.plugins.providers.IIOImageProviderHelper")
final class DeleteIIOImageProviderHelper {
}

0 comments on commit 515ca8a

Please sign in to comment.