summaryrefslogtreecommitdiff
path: root/component.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'component.cpp')
-rw-r--r--component.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/component.cpp b/component.cpp
index 03be498a..30431e90 100644
--- a/component.cpp
+++ b/component.cpp
@@ -25,13 +25,19 @@ Component::Component(BNComponent* component)
std::string Component::GetDisplayName()
{
- return BNComponentGetDisplayName(m_object);
+ char* result = BNComponentGetDisplayName(m_object);
+ string stringResult = result;
+ BNFreeString(result);
+ return stringResult;
}
std::string Component::GetName()
{
- return BNComponentGetOriginalName(m_object);
+ char* result = BNComponentGetOriginalName(m_object);
+ string stringResult = result;
+ BNFreeString(result);
+ return stringResult;
}
@@ -55,7 +61,10 @@ Ref<Component> Component::GetParent()
std::string Component::GetGuid()
{
- return string(BNComponentGetGuid(m_object));
+ char* result = BNComponentGetGuid(m_object);
+ string stringResult = result;
+ BNFreeString(result);
+ return stringResult;
}