@@ -470,36 +470,29 @@ static void
470470imageinfo_finalize ( GObject * gobject )
471471{
472472 Imageinfo * imageinfo = IMAGEINFO ( gobject );
473- gboolean isfile = imageinfo -> im ? im_isfile ( imageinfo -> im ) : FALSE;
474- char name [FILENAME_MAX ];
473+ gboolean isfile = imageinfo -> im && im_isfile ( imageinfo -> im );
475474
476475#ifdef DEBUG_MAKE
477476 printf ( "imageinfo_finalize:" );
478477 imageinfo_print ( imageinfo );
479478#endif /*DEBUG_MAKE*/
480479
481- if ( imageinfo -> dfile && isfile ) {
482- /* We must close before we delete ... save the filename.
483- */
484- im_strncpy ( name , imageinfo -> im -> filename , FILENAME_MAX - 5 );
485-
486- #ifdef DEBUG_OPEN
487- printf ( "imageinfo_destroy: unlinking \"%s\"\n" , name );
488- #endif /*DEBUG_OPEN*/
489- }
490-
491480 IM_FREEF ( im_close , imageinfo -> im );
492481 IM_FREEF ( im_close , imageinfo -> mapped_im );
493482 IM_FREEF ( im_close , imageinfo -> identity_lut );
494483
495484 if ( imageinfo -> dfile &&
496- imageinfo -> delete_name &&
485+ imageinfo -> delete_filename &&
497486 isfile ) {
498- unlinkf ( "%s" , imageinfo -> delete_name );
487+ #ifdef DEBUG_OPEN
488+ printf ( "imageinfo_destroy: unlinking \"%s\"\n" , name );
489+ #endif /*DEBUG_OPEN*/
490+
491+ unlinkf ( "%s" , imageinfo -> delete_filename );
499492 iobject_changed ( IOBJECT ( main_imageinfogroup ) );
500493 }
501494
502- VIPS_FREE ( imageinfo -> delete_name );
495+ VIPS_FREE ( imageinfo -> delete_filename );
503496
504497 MANAGED_UNREF ( imageinfo -> underlying );
505498
@@ -630,7 +623,7 @@ imageinfo_init( Imageinfo *imageinfo )
630623 imageinfo -> proxy = NULL ;
631624
632625 imageinfo -> dfile = FALSE;
633- imageinfo -> delete_name = NULL ;
626+ imageinfo -> delete_filename = NULL ;
634627 imageinfo -> from_file = FALSE;
635628 imageinfo -> mtime = 0 ;
636629 imageinfo -> exprs = NULL ;
@@ -817,7 +810,7 @@ imageinfo_new_temp( Imageinfogroup *imageinfogroup,
817810 return ( NULL );
818811 }
819812 imageinfo -> dfile = TRUE;
820- VIPS_SETSTR ( imageinfo -> delete_name , tname );
813+ VIPS_SETSTR ( imageinfo -> delete_filename , tname );
821814
822815 return ( imageinfo );
823816}
0 commit comments