~ubuntu-branches/ubuntu/vivid/nip2/vivid-proposed

« back to all changes in this revision

Viewing changes to src/main.c

  • Committer: Package Import Robot
  • Author(s): Jay Berkenbilt
  • Date: 2012-03-18 17:12:03 UTC
  • mfrom: (1.6.3)
  • Revision ID: package-import@ubuntu.com-20120318171203-tyz1ohtgsktf3uk1
Tags: 7.28.1-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
#define DEBUG_TIME
57
57
 */
58
58
 
59
 
/* On quit, make sure we free stuff we can free. Define PROFILE too to get
60
 
 * glib's mem use profiler. But it's broken on windows and will cause strange
61
 
 * problems, careful.
 
59
/* On quit, make sure we free stuff we can free. 
62
60
#define DEBUG_LEAK
63
 
#define PROFILE
64
61
 */
65
62
 
66
63
/* Sometimes we need to be able to disable these at build time.
67
 
#undef DEBUG_FATAL
68
64
#undef DEBUG_LEAK
69
 
 */
70
 
 
71
 
/* Need im__print_all() for leak testing.
72
 
 */
73
 
#ifdef DEBUG_LEAK
74
 
extern void im__print_all( void );
75
 
#endif /*DEBUG_LEAK*/
 
65
#undef DEBUG_FATAL
 
66
 */
76
67
 
77
68
/* General stuff. 
78
69
 */
332
323
        reduce_destroy( reduce_context );
333
324
 
334
325
#ifdef DEBUG_LEAK
335
 
        fprintf( stderr, "DEBUG_LEAK: testing for leaks ...\n" );
336
 
 
337
326
        /* Free other GTK stuff.
338
327
         */
339
328
        if( main_icon_factory )
357
346
         */
358
347
        UNREF( main_imageinfogroup );
359
348
        heap_check_all_destroyed();
360
 
        im__print_all();
 
349
        vips_shutdown();
361
350
        managed_check_all_destroyed();
362
351
        util_check_all_destroyed();
363
352
        call_check_all_destroyed();
364
 
 
365
 
#ifdef PROFILE
366
 
        g_mem_profile();
367
 
#endif /*PROFILE*/
368
353
#endif /*DEBUG_LEAK*/
369
354
 
370
355
#ifdef DEBUG
887
872
                expand_variables( PATH_TMP, tmp );
888
873
                nativeize_path( tmp );
889
874
                absoluteize_path( tmp );
890
 
                to_size( &buf, total );
 
875
                vips_buf_append_size( &buf, total );
891
876
 
892
877
                box_yesno( NULL,
893
878
                        main_toobig_done, iwindow_true_cb, NULL,
987
972
        char txt[MAX_STRSIZE];
988
973
        VipsBuf buf = VIPS_BUF_STATIC( txt );
989
974
 
990
 
#ifdef DEBUG_LEAK
991
 
#ifdef PROFILE
992
 
        g_mem_set_vtable( glib_mem_profiler_table );
993
 
#endif /*PROFILE*/
994
 
#endif /*DEBUG_LEAK*/
995
 
 
996
975
#ifdef DEBUG_TIME
997
976
        GTimer *startup_timer = g_timer_new();
998
977
        printf( "DEBUG_TIME: startup timer zeroed ...\n" );
1130
1109
                exit( 0 );
1131
1110
        }
1132
1111
 
1133
 
#ifdef DEBUG_LEAK
1134
 
        fprintf( stderr, 
1135
 
                "*** DEBUG_LEAK is on ... will leaktest on exit\n" );
1136
 
#endif /*DEBUG_LEAK*/
1137
 
 
1138
1112
#ifdef DEBUG_FATAL
1139
1113
        /* Set masks for debugging ... stop on any problem. 
1140
1114
         */
1144
1118
                G_LOG_LEVEL_ERROR |
1145
1119
                G_LOG_LEVEL_CRITICAL |
1146
1120
                G_LOG_LEVEL_WARNING );
1147
 
 
1148
 
        fprintf( stderr, 
1149
 
                "*** DEBUG_FATAL is on ... will abort() on first warning\n" );
1150
1121
#else /*!DEBUG_FATAL*/
1151
1122
#ifdef OS_WIN32 
1152
1123
        /* No logging output ... on win32, log output pops up a very annoying
1503
1474
                gtk_main();
1504
1475
        }
1505
1476
 
1506
 
        if( main_option_test && expr_error_all )
1507
 
                main_error_exit( "--test: errors found" );
 
1477
        if( main_option_test ) {
 
1478
                /* Make sure we've had at least one recomp.
 
1479
                 */
 
1480
                symbol_recalculate_all_force( TRUE );
 
1481
                if( expr_error_all )
 
1482
                        main_error_exit( "--test: errors found" );
 
1483
        }
1508
1484
 
1509
1485
        /* No return from this.
1510
1486
         */