void Parser::FNSyntax_DeleteExpression(ExprNode *node) { ExprNode *temp = NULL; for(ExprNode *i = node; i != NULL; i = i->next) { if(temp != NULL) { POV_FREE(temp); } FNSyntax_DeleteExpression(i->child); if((i->op == OP_VARIABLE) || (i->op == OP_MEMBER)) { POV_FREE(i->variable); } else if(i->op == OP_CALL) { if((i->call.token == FUNCT_ID_TOKEN) || (i->call.token == VECTFUNCT_ID_TOKEN)) dynamic_cast<FunctionVM*>(sceneData->functionContextFactory)->RemoveFunction(i->call.fn); POV_FREE(i->call.name); } temp = i; } if(temp != NULL) { POV_FREE(temp); } }
void Destroy_Blend_Map (BLEND_MAP *BMap) { int i; if (BMap != NULL) { if (--(BMap->Users) == 0) { for (i = 0; i < BMap->Number_Of_Entries; i++) { switch (BMap->Type) { case PIGMENT_TYPE: case DENSITY_TYPE: Destroy_Pigment(BMap->Blend_Map_Entries[i].Vals.Pigment); break; case NORMAL_TYPE: Destroy_Tnormal(BMap->Blend_Map_Entries[i].Vals.Tnormal); break; case TEXTURE_TYPE: Destroy_Textures(BMap->Blend_Map_Entries[i].Vals.Texture); } } POV_FREE (BMap->Blend_Map_Entries); POV_FREE (BMap); } } }
void FNSyntax_DeleteExpression(ExprNode *node) { ExprNode *temp = NULL; for(ExprNode *i = node; i != NULL; i = i->next) { if(temp != NULL) { POV_FREE(temp); } FNSyntax_DeleteExpression(i->child); if((i->op == OP_VARIABLE) || (i->op == OP_MEMBER)) { POV_FREE(i->variable); } else if(i->op == OP_CALL) { if((i->call.token == FUNCT_ID_TOKEN) || (i->call.token == VECTFUNCT_ID_TOKEN)) POVFPU_RemoveFunction(i->call.fn); POV_FREE(i->call.name); } temp = i; } if(temp != NULL) { POV_FREE(temp); } }
void BicubicPatch::bezier_tree_deleter(BEZIER_NODE *Node) { int i; BEZIER_CHILDREN *Children; /* If this is an interior node then continue the descent. */ if (Node->Node_Type == BEZIER_INTERIOR_NODE) { Children = reinterpret_cast<BEZIER_CHILDREN *>(Node->Data_Ptr); for (i = 0; i < Node->Count; i++) { bezier_tree_deleter(Children->Children[i]); } POV_FREE(Children); } else { if (Node->Node_Type == BEZIER_LEAF_NODE) { /* Free the memory used for the vertices. */ POV_FREE(Node->Data_Ptr); } } /* Free the memory used for the node. */ POV_FREE(Node); }
void Destroy_Priority_Queue(PRIORITY_QUEUE *Queue) { if (Queue != NULL) { POV_FREE(Queue->Queue); POV_FREE(Queue); } }
static void cleanup_gif_decoder () { POV_FREE (dstack); POV_FREE (suffix); POV_FREE (prefix); dstack = NULL; suffix = NULL; prefix = NULL; }
Polygon::~Polygon() { if (--(Data->References) == 0) { POV_FREE (Data->Points); POV_FREE (Data); } Destroy_Transform(Trans); }
void Destroy_Spline(SPLINE * Spline) { if (Spline->ref_count <= 0) throw POV_EXCEPTION_STRING("Internal error: Invalid spline reference count\n"); Spline->ref_count --; if (Spline->ref_count == 0) { POV_FREE(Spline->SplineEntries); POV_FREE(Spline); } }
Lathe::~Lathe() { Destroy_Transform(Trans); if (--(Spline->References) == 0) { Destroy_BCyl(Spline->BCyl); POV_FREE(Spline->Entry); POV_FREE(Spline); } }
static void Destroy_Polygon(OBJECT *Object) { POLYGON *Polyg = (POLYGON *)Object; if (--(Polyg->Data->References) == 0) { POV_FREE (Polyg->Data->Points); POV_FREE (Polyg->Data); } Destroy_Transform(Polyg->Trans); POV_FREE (Object); }
TraceThreadData::~TraceThreadData() { delete functionContext; for(vector<GenericFunctionContextPtr>::iterator i = functionPatternContext.begin(); i != functionPatternContext.end(); ++i) delete *i; POV_FREE(Blob_Coefficients); POV_FREE(Blob_Queue); POV_FREE(isosurfaceData); Fractal::Free_Iteration_Stack(Fractal_IStack); delete surfacePhotonMap; delete mediaPhotonMap; delete[] Blob_Intervals; for(vector<LightSource *>::iterator it = lightSources.begin(); it != lightSources.end(); it++) Destroy_Object(*it); }
UCS2 *Parser::Parse_Substr(bool pathname) { UCS2 *str; UCS2 *New; int l, d; GET(LEFT_PAREN_TOKEN); str = Parse_String(pathname); Parse_Comma(); l = (int)Parse_Float(); Parse_Comma(); d = (int)Parse_Float(); GET(RIGHT_PAREN_TOKEN); if(((l + d - 1) > UCS2_strlen(str)) || (l < 0) || (d < 0)) Error("Illegal parameters in substr."); New = reinterpret_cast<UCS2 *>(POV_MALLOC(sizeof(UCS2) * (d + 1), "temporary string")); UCS2_strncpy(New, &(str[l - 1]), d); New[d] = 0; POV_FREE(str); return New; }
IsoSurface::~IsoSurface() { if(--mginfo->refcnt == 0) POV_FREE(mginfo); delete Function; Destroy_Transform(Trans); }
UCS2 *Parser::Parse_Concat(bool pathname) { UCS2 *str; UCS2 *New; GET(LEFT_PAREN_TOKEN); New = Parse_String(); EXPECT CASE(RIGHT_PAREN_TOKEN) EXIT END_CASE OTHERWISE UNGET Parse_Comma(); str = Parse_String(pathname); New = UCS2_strcat(New, str); POV_FREE(str); END_CASE END_EXPECT return New; }
std::string Parser::Parse_SysString(bool pathname, bool require) { UCS2 *cstr = Parse_String(pathname, require); std::string ret(UCS2toSysString(cstr)); POV_FREE(cstr); return ret; }
void Parser::Destroy_Function(FUNCTION_PTR Function) { if(Function != NULL) { sceneData->functionVM->RemoveFunction(*Function); POV_FREE(Function); } }
void Parser::Destroy_Function(FunctionVM *functionVM, FUNCTION_PTR Function) { if(Function != NULL) { functionVM->RemoveFunction(*Function); POV_FREE(Function); } }
void Deinitialize_VLBuffer_Code() { if (Node_Queue != NULL) { POV_FREE(Node_Queue->Queue); POV_FREE(Node_Queue); } if (VLBuffer_Queue != NULL) { Destroy_Priority_Queue(VLBuffer_Queue); } Node_Queue = NULL; VLBuffer_Queue = NULL; }
static void Destroy_Bicubic_Patch(OBJECT *Object) { BICUBIC_PATCH *Patch; Patch = (BICUBIC_PATCH *)Object; if (Patch->Patch_Type == 1) { if (Patch->Node_Tree != NULL) { bezier_tree_deleter(Patch->Node_Tree); } } if ( Patch->Weights != NULL ) POV_FREE(Patch->Weights); POV_FREE(Patch); }
void Parametric::Destroy_PrecompParVal() { if (PData == NULL) return; PData->use--; if (PData->use == 0) { if (PData->flags & OK_X) { POV_FREE(PData->Low[0]); POV_FREE(PData->Hi[0]); } if (PData->flags & OK_Y) { POV_FREE(PData->Low[1]); POV_FREE(PData->Hi[1]); } if (PData->flags & OK_Z) { POV_FREE(PData->Low[2]); POV_FREE(PData->Hi[2]); } POV_FREE(PData); } }
void Destroy_PrecompParVal(PRECOMP_PAR_DATA* PPV) { if (PPV == NULL) return; PPV->use--; if (PPV->use == 0) { if (PPV->flags & OK_X) { POV_FREE(PPV->Low[0]); POV_FREE(PPV->Hi[0]); } if (PPV->flags & OK_Y) { POV_FREE(PPV->Low[1]); POV_FREE(PPV->Hi[1]); } if (PPV->flags & OK_Z) { POV_FREE(PPV->Low[2]); POV_FREE(PPV->Hi[2]); } POV_FREE(PPV); } }
void Destroy_Tnormal(TNORMAL *Tnormal) { if (Tnormal != NULL) { Destroy_TPat_Fields ((TPATTERN *)Tnormal); POV_FREE(Tnormal); } }
void Destroy_BBox_Tree(BBOX_TREE *Node) { if(Node != NULL) { if(Node->Entries > 0) { for(short i = 0; i < Node->Entries; i++) Destroy_BBox_Tree(Node->Node[i]); POV_FREE(Node->Node); Node->Entries = 0; Node->Node = NULL; } POV_FREE(Node); } }
void Destroy_Interior(INTERIOR *Interior) { if ((Interior != NULL) && (--(Interior->References) == 0)) { Destroy_Media(Interior->IMedia); POV_FREE(Interior); } }
void Destroy_Fog(FOG *Fog) { if (Fog != NULL) { Destroy_Turb(Fog->Turb); POV_FREE(Fog); } }
void Destroy_Rainbow(RAINBOW *Rainbow) { if (Rainbow != NULL) { Destroy_Pigment(Rainbow->Pigment); POV_FREE(Rainbow); } }
void Destroy_Skysphere(SKYSPHERE *Skysphere) { int i; if (Skysphere != NULL) { for (i = 0; i < Skysphere->Count; i++) { Destroy_Pigment(Skysphere->Pigments[i]); } POV_FREE(Skysphere->Pigments); Destroy_Transform(Skysphere->Trans); POV_FREE(Skysphere); } }
void Destroy_IStacks() { ISTACK *istk, *temp; istk = free_istack; while (istk != NULL) { temp = istk; istk = istk->next; POV_FREE (temp->istack); POV_FREE (temp); } free_istack = NULL; }
void Destroy_Camera(CAMERA *Camera) { if (Camera != NULL) { Destroy_Tnormal(Camera->Tnormal); Destroy_Transform(Camera->Trans); POV_FREE(Camera); } }
void Destroy_Parametric(OBJECT* Object) { Destroy_Transform(((PARAMETRIC *)Object)->Trans); Destroy_Function(((PARAMETRIC *)Object)->Function[0]); Destroy_Function(((PARAMETRIC *)Object)->Function[1]); Destroy_Function(((PARAMETRIC *)Object)->Function[2]); Destroy_PrecompParVal(((PARAMETRIC *)Object)->PData); POV_FREE(Object); }