static void destroySWFDBLBitmap_andInputs(SWFDBLBitmap bitmap) { if ( bitmap->input != NULL ) destroySWFInput(bitmap->input); // The bounds rectangle will be already freed in destroySWFCharacter /*if ( CHARACTER(bitmap)->bounds != NULL ) destroySWFRect(CHARACTER(bitmap)->bounds);*/ destroySWFCharacter((SWFCharacter) bitmap); }
static void destroySWFDBLBitmapData(SWFDBLBitmapData bitmap) { if ( bitmap->data != NULL ) { free(bitmap->data); } #if TRACK_ALLOCS ming_gc_remove_node(bitmap->gcnode); #endif destroySWFCharacter((SWFCharacter) bitmap); }
void destroySWFTextField(SWFTextField field) { destroySWFOutput(field->out); if ( field->varName != NULL ) free(field->varName); if ( field->string != NULL ) free(field->string); if ( field->embeds != NULL ) free(field->embeds); destroySWFCharacter((SWFCharacter) field); }
void destroySWFShape(SWFShape shape) { int i; if(shape->fills != NULL) { // Fills have to be destroyed by users. /* for ( i=0; i<shape->nFills; ++i ) destroySWFFillStyle(shape->fills[i]); */ free(shape->fills); } if(shape->records != NULL) { for(i = 0; i < shape->nRecords; i++) { free(shape->records[i].record.stateChange); } free(shape->records); } if(shape->edgeBounds != NULL) free(shape->edgeBounds); for ( i=0; i<shape->nLines; ++i ) free(shape->lines[i]); if ( shape->lines != NULL ) free(shape->lines); destroySWFOutput(shape->out); #if TRACK_ALLOCS ming_gc_remove_node(shape->gcnode); #endif destroySWFCharacter((SWFCharacter) shape); }
void destroySWFText(SWFText text) { SWFTextRecord record = text->initialRecord, next; destroySWFOutput(text->out); if ( text->matrix != NULL ) destroySWFMatrix(text->matrix); while ( record != NULL ) { next = record->next; destroySWFTextRecord(record); record = next; } #if TRACK_ALLOCS ming_gc_remove_node(text->gcnode); #endif destroySWFCharacter((SWFCharacter) text); }
void destroySWFShape(SWFShape shape) { int i, j; destroySWFOutput(shape->out); if (shape->isUsingNewStyles != TRUE) { for ( i=0; i<*shape->nFills; ++i ) { SWFMatrix matrix = SWFFillStyle_getMatrix((*shape->fills)[i]); if ( matrix != NULL ) destroySWFMatrix(matrix); /* gradients and bitmaps are destroyed separately */ free((*shape->fills)[i]); } if ( *shape->fills != NULL ) free(*shape->fills); for ( i=0; i<*shape->nLines; ++i ) free((*shape->lines)[i]); if ( *shape->lines != NULL ) free(*shape->lines); } if (shape->isEnded != TRUE) { for ( i=0; i<shape->nRecords; ++i ) { ShapeRecord record = shape->records[i]; if (record.type == SHAPERECORD_STATECHANGE && record.record.stateChange->flags & SWF_SHAPE_NEWSTYLEFLAG) { for ( j=0; i<record.record.stateChange->nFills; ++j ) { SWFMatrix matrix = SWFFillStyle_getMatrix(record.record.stateChange->fills[j]); if ( matrix != NULL ) destroySWFMatrix(matrix); /* gradients and bitmaps are destroyed separately */ free(record.record.stateChange->fills[j]); } if ( record.record.stateChange->fills != NULL ) free(record.record.stateChange->fills); for ( j=0; j<record.record.stateChange->nLines; ++j ) free(record.record.stateChange->lines[j]); if ( record.record.stateChange->lines != NULL ) free(record.record.stateChange->lines); } free(record.record.stateChange); /* all in union are pointers */ } free(shape->records); } #if TRACK_ALLOCS ming_gc_remove_node(shape->gcnode); #endif destroySWFCharacter((SWFCharacter) shape); }
/* * destroys a SWFPrebuiltClip instance */ void destroySWFPrebuiltClip(SWFPrebuiltClip clip) { destroySWFOutput(clip->display); destroySWFCharacter((SWFCharacter) clip); }