@@ -470,36 +470,29 @@ static void
470
470
imageinfo_finalize ( GObject * gobject )
471
471
{
472
472
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 );
475
474
476
475
#ifdef DEBUG_MAKE
477
476
printf ( "imageinfo_finalize:" );
478
477
imageinfo_print ( imageinfo );
479
478
#endif /*DEBUG_MAKE*/
480
479
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
-
491
480
IM_FREEF ( im_close , imageinfo -> im );
492
481
IM_FREEF ( im_close , imageinfo -> mapped_im );
493
482
IM_FREEF ( im_close , imageinfo -> identity_lut );
494
483
495
484
if ( imageinfo -> dfile &&
496
- imageinfo -> delete_name &&
485
+ imageinfo -> delete_filename &&
497
486
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 );
499
492
iobject_changed ( IOBJECT ( main_imageinfogroup ) );
500
493
}
501
494
502
- VIPS_FREE ( imageinfo -> delete_name );
495
+ VIPS_FREE ( imageinfo -> delete_filename );
503
496
504
497
MANAGED_UNREF ( imageinfo -> underlying );
505
498
@@ -630,7 +623,7 @@ imageinfo_init( Imageinfo *imageinfo )
630
623
imageinfo -> proxy = NULL ;
631
624
632
625
imageinfo -> dfile = FALSE;
633
- imageinfo -> delete_name = NULL ;
626
+ imageinfo -> delete_filename = NULL ;
634
627
imageinfo -> from_file = FALSE;
635
628
imageinfo -> mtime = 0 ;
636
629
imageinfo -> exprs = NULL ;
@@ -817,7 +810,7 @@ imageinfo_new_temp( Imageinfogroup *imageinfogroup,
817
810
return ( NULL );
818
811
}
819
812
imageinfo -> dfile = TRUE;
820
- VIPS_SETSTR ( imageinfo -> delete_name , tname );
813
+ VIPS_SETSTR ( imageinfo -> delete_filename , tname );
821
814
822
815
return ( imageinfo );
823
816
}
0 commit comments