Skip to content

Commit

Permalink
[cage] clean init and destroy on several pmc, TT #895
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.parrot.org/parrot/trunk@40365 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
NotFound committed Aug 1, 2009
1 parent a727d55 commit 9d29343
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/pmc/fixedintegerarray.pmc
Expand Up @@ -155,6 +155,7 @@ Destroys the array.
if (int_array)
mem_sys_free(int_array);
mem_sys_free(PMC_data(SELF));
PMC_data(SELF) = NULL;
}

/*
Expand Down
1 change: 1 addition & 0 deletions src/pmc/fixedpmcarray.pmc
Expand Up @@ -87,6 +87,7 @@ Destroys the array.
mem_sys_free(PMC_array(SELF));
}
mem_sys_free(PMC_data(SELF));
PMC_data(SELF) = NULL;
}

/*
Expand Down
1 change: 1 addition & 0 deletions src/pmc/fixedstringarray.pmc
Expand Up @@ -69,6 +69,7 @@ Destroys the array.
mem_sys_free(str_array);

mem_sys_free(PMC_data(SELF));
PMC_data(SELF) = NULL;
}

/*
Expand Down
3 changes: 2 additions & 1 deletion src/pmc/float.pmc
Expand Up @@ -34,8 +34,8 @@ Initializes the number to zero.
VTABLE void init() {
Parrot_Float_attributes * const fattr = mem_allocate_zeroed_typed(Parrot_Float_attributes);

fattr->fv = 0.0;
PMC_data(SELF) = fattr;
SET_ATTR_fv(INTERP, SELF, 0.0);

PObj_active_destroy_SET(SELF);
}
Expand All @@ -51,6 +51,7 @@ Destroy this PMC.

VTABLE void destroy() {
mem_sys_free(PMC_data(SELF));
PMC_data(SELF) = NULL;
}
/*

Expand Down
1 change: 1 addition & 0 deletions src/pmc/hash.pmc
Expand Up @@ -409,6 +409,7 @@ Free hash structure.
parrot_hash_destroy(INTERP, hash);

mem_sys_free(PMC_data(SELF));
PMC_data(SELF) = NULL;
}
/*

Expand Down
1 change: 1 addition & 0 deletions src/pmc/object.pmc
Expand Up @@ -153,6 +153,7 @@ Free the object's underlying struct.
*/
VTABLE void destroy() {
mem_sys_free(PMC_data(SELF));
PMC_data(SELF) = NULL;
}

/*
Expand Down
4 changes: 3 additions & 1 deletion src/pmc/parrotinterpreter.pmc
Expand Up @@ -277,8 +277,10 @@ Destroys the PMC.
*/

VTABLE void destroy() {
if (PMC_data(SELF))
if (PMC_data(SELF)) {
mem_sys_free(PMC_data(SELF));
PMC_data(SELF) = NULL;
}
}


Expand Down
1 change: 1 addition & 0 deletions src/pmc/unmanagedstruct.pmc
Expand Up @@ -691,6 +691,7 @@ Destroys the subroutine.

VTABLE void destroy() {
mem_sys_free(PMC_data(SELF));
PMC_data(SELF) = NULL;
}


Expand Down

0 comments on commit 9d29343

Please sign in to comment.