Also unref the proto on destruction of the translator.
return proto;
}
-
-struct caseproto *
-caseproto_clone (const struct caseproto *in)
-{
- struct caseproto *proto = xmalloc (caseproto_size (in->n_widths));
- proto->ref_cnt = 1;
-
- proto->n_widths = in->n_widths;
- proto->allocated_widths = in->allocated_widths;
-
- memcpy (proto->widths, in->widths, proto->n_widths * sizeof *proto->widths);
-
- proto->n_long_strings = in->n_long_strings;
- proto->long_strings = NULL;
- if ( proto->n_long_strings > 0)
- caseproto_refresh_long_string_cache__ (proto);
-
- return proto;
-}
-
static void
do_unref (void *proto_)
{
/* Creation and destruction. */
struct caseproto *caseproto_create (void) MALLOC_LIKE;
-struct caseproto *caseproto_clone (const struct caseproto *) ;
static inline struct caseproto *caseproto_ref (const struct caseproto *);
struct caseproto *caseproto_ref_pool (const struct caseproto *, struct pool *);
static inline void caseproto_unref (struct caseproto *);
struct consolidator *cdr = aux;
casereader_destroy (cdr->clone);
+ caseproto_unref (cdr->proto);
free (cdr);
return true;
{
struct casereader *u ;
struct casereader *ud ;
- struct caseproto *output_proto = caseproto_clone (casereader_get_proto (input));
+ struct caseproto *output_proto = caseproto_ref (casereader_get_proto (input));
struct consolidator *cdr = xmalloc (sizeof (*cdr));
cdr->n = 0;