Revision 10ddaca7 src/PeerSampler/cloudcast.c

View differences:

src/PeerSampler/cloudcast.c
481 481
  return cloudcast_proto_change_metadata(context->proto_context, metadata, metadata_size);
482 482
}
483 483

  
484
void cloudcast_destroy(struct peersampler_context **context)
485
{
486
	if (context && *context)
487
	{
488
		if((*context)->r)
489
			free((*context)->r);
490
		if((*context)->local_cache)
491
			cache_free((*context)->local_cache);
492
		if((*context)->flying_cache)
493
			cache_free((*context)->flying_cache);
494
		free(*context);
495
		*context = NULL;
496
	}
497
}
498

  
484 499
struct peersampler_iface cloudcast = {
485 500
  .init = cloudcast_init,
501
  .destroy = cloudcast_destroy,
486 502
  .change_metadata = cloudcast_change_metadata,
487 503
  .add_neighbour = cloudcast_add_neighbour,
488 504
  .parse_data = cloudcast_parse_data,

Also available in: Unified diff