EST_Item_Content.cc (speech_tools-2.4-release) | : | EST_Item_Content.cc (speech_tools-2.5.0-release) | ||
---|---|---|---|---|
skipping to change at line 66 | skipping to change at line 66 | |||
if (relations.length() != 0) | if (relations.length() != 0) | |||
{ // Shouldn't get here, but just in case. | { // Shouldn't get here, but just in case. | |||
cerr << "EST_Contents: contents still referenced by Relations" << endl; | cerr << "EST_Contents: contents still referenced by Relations" << endl; | |||
} | } | |||
} | } | |||
int EST_Item_Content::unref_relation(const EST_String &relname) | int EST_Item_Content::unref_relation(const EST_String &relname) | |||
{ | { | |||
// Unreference this item from this relation. Returns TRUE | // Unreference this item from this relation. Returns TRUE | |||
// if no one else is referencing it, FALSE otherwise | // if no one else is referencing it, FALSE otherwise | |||
if (this != 0) | if ((relname == "") && (relations.length() == 1)) | |||
{ | { // sigh, something to with isolated EST_Items and | |||
if ((relname == "") && (relations.length() == 1)) | // SunCC causes a problems in exit(), so hit it with | |||
{ // sigh, something to with isolated EST_Items and | // a bigger stick | |||
// SunCC causes a problems in exit(), so hit it with | relations.clear(); | |||
// a bigger stick | return TRUE; | |||
relations.clear(); | ||||
return TRUE; | ||||
} | ||||
if (relations.present(relname)) | ||||
relations.remove_item(relname); | ||||
else | ||||
printf("failed to find %s in %s at %g\n", | ||||
(const char *)relname, | ||||
(const char *)name(), | ||||
f.F("end",0.0)); | ||||
if (relations.length() == 0) | ||||
return TRUE; | ||||
} | } | |||
if (relations.present(relname)) | ||||
relations.remove_item(relname); | ||||
else | ||||
printf("failed to find %s in %s at %g\n", | ||||
(const char *)relname, | ||||
(const char *)name(), | ||||
f.F("end",0.0)); | ||||
if (relations.length() == 0) | ||||
return TRUE; | ||||
return FALSE; | return FALSE; | |||
} | } | |||
int EST_Item_Content::unref_and_delete() | int EST_Item_Content::unref_and_delete() | |||
{ | { | |||
// Unreference from all relations and delete | // Unreference from all relations and delete | |||
EST_Item *np; | EST_Item *np; | |||
EST_Litem *p; | EST_Litem *p; | |||
for (p=relations.list.head(); p;) | for (p=relations.list.head(); p;) | |||
End of changes. 2 change blocks. | ||||
18 lines changed or deleted | 15 lines changed or added |