Michael Natterer wrote:
Sven Neumann <sven@xxxxxxxx> writes:
Here's the example you gave:
gint newImage = gimp_file_load (...); gimp_displays_reconnect (oldImage, newImage); gimp_image_delete (oldImage);
That last line is wrong since you never owned a reference on that image and it is already gone at that point. It should read instead:
gint newImage = gimp_file_load (...); gimp_displays_reconnect (oldImage, newImage); gimp_image_delete (newImage);
It's impossible to call gimp_image_delete() on an image which has a display, so both above pieces of code won't work. and in fact this is impossible to get right with the current implementation of gimp_displays_reconnect().
(Note: I haven't updated to 2.2pre yet, I'm still running 2.0.3.) In fact, if I remove the gimp_image_delete(oldImage), then the old image does not get removed when the display is reconnected.
If anyone wants to investigate further, the code is at:
http://members.ozemail.com.au/~hodsond/fileSeq.html
-- David Hodson -- this night wounds time