* GetName
*/
//=============================================================================
-char* GEOM_Object::GetName()
+TCollection_AsciiString GEOM_Object::GetName()
{
+ TCollection_AsciiString aName;
Handle(TDataStd_Name) aNameAttr;
- if(!_label.FindAttribute(TDataStd_Name::GetID(), aNameAttr)) return NULL;
-
- TCollection_AsciiString aName(aNameAttr->Get());
+ if(_label.FindAttribute(TDataStd_Name::GetID(), aNameAttr))
+ aName = aNameAttr->Get();
// do not return pointer of local variable
// return aName.ToCString();
// the following code could lead to memory leak, so take care about recieved pointer
- return strdup(aName.ToCString());
+ return aName;
}
//=============================================================================
Standard_EXPORT void SetName(const char* theName);
//Returns a name of this GEOM_Object
- Standard_EXPORT char* GetName();
+ Standard_EXPORT TCollection_AsciiString GetName();
//Sets a color of this GEOM_Object
Standard_EXPORT void SetColor(const Color& theColor);