kopia lustrzana https://gitlab.com/sane-project/backends
Make sure net backend release all memory when finished.
rodzic
6ce374246d
commit
165e106361
|
@ -413,8 +413,11 @@ sane_exit (void)
|
|||
sanei_w_call (&dev->wire, SANE_NET_EXIT,
|
||||
(WireCodecFunc) sanei_w_void, 0,
|
||||
(WireCodecFunc) sanei_w_void, 0);
|
||||
sanei_w_exit(&dev->wire);
|
||||
close (dev->ctl);
|
||||
}
|
||||
if (dev->name)
|
||||
free(dev->name);
|
||||
free (dev);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,6 +70,7 @@ typedef struct Wire
|
|||
Wire;
|
||||
|
||||
extern void sanei_w_init (Wire *w, void (*codec_init)(Wire *));
|
||||
extern void sanei_w_exit (Wire *w);
|
||||
extern void sanei_w_space (Wire *w, size_t howmuch);
|
||||
extern void sanei_w_void (Wire *w);
|
||||
extern void sanei_w_byte (Wire *w, SANE_Byte *v);
|
||||
|
|
|
@ -446,3 +446,12 @@ sanei_w_init (Wire *w, void (*codec_init_func)(Wire *))
|
|||
if (codec_init_func != 0)
|
||||
(*codec_init_func) (w);
|
||||
}
|
||||
|
||||
void
|
||||
sanei_w_exit (Wire *w)
|
||||
{
|
||||
if (w->buffer.start)
|
||||
free(w->buffer.start);
|
||||
w->buffer.start = 0;
|
||||
w->buffer.size = 0;
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue