00001 00017 #include "mfcpch.h" 00018 #include "expandblob.h" 00019 #include "tessclas.h" 00020 #include "const.h" 00021 #include "structures.h" 00022 #include "freelist.h" 00023 00028 void free_blob( /*blob to free */ 00029 register TBLOB *blob) { 00030 if (blob == NULL) 00031 return; /*duff blob */ 00032 free_tree (blob->outlines); /*do the tree of outlines */ 00033 oldblob(blob); /*free the actual blob */ 00034 } 00035 00036 00040 void free_tree( /*outline to draw */ 00041 register TESSLINE *outline) { 00042 if (outline == NULL) 00043 return; /*duff outline */ 00044 if (outline->next != NULL) 00045 free_tree (outline->next); 00046 if (outline->child != NULL) 00047 free_tree (outline->child); /*and sub-tree */ 00048 free_outline(outline); /*free the outline */ 00049 } 00050 00051 00055 void free_outline( /*outline to free */ 00056 register TESSLINE *outline) { 00057 if (outline->compactloop != NULL) 00058 /*no compact loop */ 00059 memfree (outline->compactloop); 00060 00061 if (outline->loop != NULL) 00062 free_loop (outline->loop); 00063 00064 oldoutline(outline); 00065 } 00066 00067 00071 void free_loop( /*outline to free */ 00072 register EDGEPT *startpt) { 00073 register EDGEPT *edgept; /*current point */ 00074 00075 if (startpt == NULL) 00076 return; 00077 edgept = startpt; 00078 do { 00079 edgept = oldedgept (edgept); /*free it and move on */ 00080 } 00081 while (edgept != startpt); 00082 }