pike.git / src / modules / SANE / sane.c

version» Context lines:

pike.git/src/modules/SANE/sane.c:344:    }   }      static void assert_image_program()   {    if( !image_program )    {    push_text( "Image.Image" );    APPLY_MASTER( "resolv", 1 );    image_program = program_from_svalue( sp - 1 ); -  pop_stack(); +  sp--;/* Do not free image program.. */    }   }      static void f_scanner_simple_scan( INT32 args )   {    SANE_Parameters p;    SANE_Handle h = THIS->h;    struct object *o;    rgb_group *r;       -  +  assert_image_program(); +     pop_n_elems( args );    if( sane_start( THIS->h ) ) error("Start failed\n");    if( sane_get_parameters( THIS->h, &p ) ) error("Get parameters failed\n");       if( p.depth != 8 )    error("Sorry, only depth 8 supported right now.\n");       push_int( p.pixels_per_line );    push_int( p.lines );    o = clone_object( image_program, 2 );
pike.git/src/modules/SANE/sane.c:518:    set_exit_callback(exit_scanner_struct);       add_program_constant( "Scanner", (p=end_program( ) ), 0 );    free_program( p );   }      void pike_module_exit()   {    if( sane_is_inited )    sane_exit(); +  if( image_program ) +  free_program( image_program );   }      #else   void pike_module_init() {}   void pike_module_exit() {}   #endif