Commit 469d65e0 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

VSM_Delete() -> VSM_Destroy() to follow our current OO schema.

parent a0b34bd4
...@@ -402,18 +402,18 @@ n_arg_sock(const char *n_arg) ...@@ -402,18 +402,18 @@ n_arg_sock(const char *n_arg)
AN(vsm); AN(vsm);
if (VSM_n_Arg(vsm, n_arg) < 0) { if (VSM_n_Arg(vsm, n_arg) < 0) {
fprintf(stderr, "%s\n", VSM_Error(vsm)); fprintf(stderr, "%s\n", VSM_Error(vsm));
VSM_Delete(vsm); VSM_Destroy(&vsm);
return (-1); return (-1);
} }
if (VSM_Open(vsm)) { if (VSM_Open(vsm)) {
fprintf(stderr, "%s\n", VSM_Error(vsm)); fprintf(stderr, "%s\n", VSM_Error(vsm));
VSM_Delete(vsm); VSM_Destroy(&vsm);
return (-1); return (-1);
} }
if (!VSM_Get(vsm, &vt, "Arg", "-T")) { if (!VSM_Get(vsm, &vt, "Arg", "-T")) {
fprintf(stderr, "No -T arg in shared memory\n"); fprintf(stderr, "No -T arg in shared memory\n");
VSM_Delete(vsm); VSM_Destroy(&vsm);
return (-1); return (-1);
} }
AZ(VSM_Map(vsm, &vt)); AZ(VSM_Map(vsm, &vt));
...@@ -426,7 +426,7 @@ n_arg_sock(const char *n_arg) ...@@ -426,7 +426,7 @@ n_arg_sock(const char *n_arg)
S_arg = strdup(vt.b); S_arg = strdup(vt.b);
} }
VSM_Delete(vsm); VSM_Destroy(&vsm);
sock = -1; sock = -1;
while (*T_arg) { while (*T_arg) {
......
...@@ -192,7 +192,7 @@ logexp_delete(struct logexp *le) ...@@ -192,7 +192,7 @@ logexp_delete(struct logexp *le)
logexp_delete_tests(le); logexp_delete_tests(le);
free(le->name); free(le->name);
free(le->query); free(le->query);
VSM_Delete(le->vsm); VSM_Destroy(&le->vsm);
if (le->n_arg) if (le->n_arg)
VSB_destroy(&le->n_arg); VSB_destroy(&le->n_arg);
FREE_OBJ(le); FREE_OBJ(le);
......
...@@ -276,7 +276,7 @@ varnishlog_thread(void *priv) ...@@ -276,7 +276,7 @@ varnishlog_thread(void *priv)
if (c) if (c)
VSL_DeleteCursor(c); VSL_DeleteCursor(c);
VSL_Delete(vsl); VSL_Delete(vsl);
VSM_Delete(vsm); VSM_Destroy(&vsm);
return (NULL); return (NULL);
} }
...@@ -335,7 +335,7 @@ varnish_delete(struct varnish *v) ...@@ -335,7 +335,7 @@ varnish_delete(struct varnish *v)
free(v->name); free(v->name);
free(v->workdir); free(v->workdir);
if (v->vd != NULL) if (v->vd != NULL)
VSM_Delete(v->vd); VSM_Destroy(&v->vd);
/* /*
* We do not delete the workdir, it may contain stuff people * We do not delete the workdir, it may contain stuff people
......
...@@ -70,7 +70,7 @@ struct vsm *VSM_New(void); ...@@ -70,7 +70,7 @@ struct vsm *VSM_New(void);
* NULL: malloc failed. * NULL: malloc failed.
*/ */
void VSM_Delete(struct vsm *vd); void VSM_Destroy(struct vsm **vd);
/* /*
* Close and deallocate all storage and mappings. * Close and deallocate all storage and mappings.
* (including any VSC and VSL "sub-classes") * (including any VSC and VSL "sub-classes")
......
...@@ -182,6 +182,7 @@ LIBVARNISHAPI_1.7 { ...@@ -182,6 +182,7 @@ LIBVARNISHAPI_1.7 {
VSM_invalid; VSM_invalid;
VSM_valid; VSM_valid;
VSM_similar; VSM_similar;
VSM_Destroy;
VSM_Map; VSM_Map;
VSM_Unmap; VSM_Unmap;
VSC_Destroy_Point; VSC_Destroy_Point;
......
...@@ -216,8 +216,13 @@ VSM_Name(const struct vsm *vd) ...@@ -216,8 +216,13 @@ VSM_Name(const struct vsm *vd)
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
void void
VSM_Delete(struct vsm *vd) VSM_Destroy(struct vsm **vdp)
{ {
struct vsm *vd;
AN(vdp);
vd = *vdp;
*vdp = NULL;
CHECK_OBJ_NOTNULL(vd, VSM_MAGIC); CHECK_OBJ_NOTNULL(vd, VSM_MAGIC);
......
...@@ -336,7 +336,7 @@ VUT_Fini(void) ...@@ -336,7 +336,7 @@ VUT_Fini(void)
if (VUT.vsl) if (VUT.vsl)
VSL_Delete(VUT.vsl); VSL_Delete(VUT.vsl);
if (VUT.vsm) if (VUT.vsm)
VSM_Delete(VUT.vsm); VSM_Destroy(&VUT.vsm);
memset(&VUT, 0, sizeof VUT); memset(&VUT, 0, sizeof VUT);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment