Implement MxVideoManager::Destroy / destructor (#207)

* MxVideoManager::Destroy / destructor

* Consistency

* Add missing override
This commit is contained in:
Christian Semmler
2023-10-14 14:46:00 -04:00
committed by GitHub
parent f062543f87
commit 5ddfaab9e7
3 changed files with 51 additions and 6 deletions

View File

@@ -65,11 +65,11 @@ MxVideoParam &MxVideoParam::operator=(const MxVideoParam &p_videoParam)
void MxVideoParam::SetDeviceName(char *id)
{
if (this->m_deviceId != 0)
free(this->m_deviceId);
delete[] this->m_deviceId;
if (id != 0)
{
this->m_deviceId = (char *)malloc(strlen(id) + 1);
this->m_deviceId = new char[strlen(id) + 1];
if (this->m_deviceId != 0) {
strcpy(this->m_deviceId, id);
@@ -84,5 +84,5 @@ void MxVideoParam::SetDeviceName(char *id)
MxVideoParam::~MxVideoParam()
{
if (this->m_deviceId != 0)
free(this->m_deviceId);
delete[] this->m_deviceId;
}