Browse Source

Delete any shares in a proxy's share hashtable on freeing it.

master
Con Kolivas 8 years ago
parent
commit
3471b299c0
  1. 14
      src/stratifier.c

14
src/stratifier.c

@ -2755,6 +2755,20 @@ static void generator_drop_proxy(ckpool_t *ckp, const int64_t id, const int subi
static void free_proxy(proxy_t *proxy) static void free_proxy(proxy_t *proxy)
{ {
sdata_t *dsdata = proxy->sdata;
/* Delete any shares in the proxy's hashtable. */
if (dsdata) {
share_t *share, *tmpshare;
mutex_lock(&dsdata->share_lock);
HASH_ITER(hh, dsdata->shares, share, tmpshare) {
HASH_DEL(dsdata->shares, share);
dealloc(share);
}
mutex_unlock(&dsdata->share_lock);
}
free(proxy->sdata); free(proxy->sdata);
free(proxy); free(proxy);
} }

Loading…
Cancel
Save