Hello everyone, i'am new in the forum then i say hello to everyone. Excuse me but i'm italian and i know less english, i hope that you understand my problem. I have written a java program written with a GUI SWT. This program receive JPEG images via socket then i have received and draw these images in this way:
JPEGDecoder decoder = JPEGCodec.createJPEGDecoder(in);
BufferedImage img = decoder.decodeAsBufferedImage();
Image image = new Image(Display.getCurrent(), converter.convertToSWT(img));
pencil.drawImage(image, 0, 0);
All this code run in a loop For( ; ; ) and it work fine but there is a problem, every time that it receive an image via socket it make the instruction new Image... and this increments the memory used. I have tried in all ways and i don't found nothing that help me. Do you know a solution for my problem? There is another way to generate an Image (without "new") or there is another JPEGDecoder that generates an Image SWT??
Please answers me because i need an help!!!

Thanks in advance and Bye to everyone!!!
