Skip to content

Commit 84e22c9

Browse files
committed
All tests pass after DeviceDefender task interface change.
1 parent 1af3791 commit 84e22c9

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

crt/aws-c-iot

devicedefender/source/DeviceDefender.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ namespace Aws
4141
: OnTaskCancelled(std::move(onCancelled)), cancellationUserdata(cancellationUserdata),
4242
m_allocator(allocator), m_status(ReportTaskStatus::Ready),
4343
m_taskConfig{nullptr},
44+
m_owningTask{nullptr},
4445
m_lastError(0),
4546
m_mqttConnection{mqttConnection},
4647
m_eventLoopGroup{eventLoopGroup}
@@ -116,7 +117,7 @@ namespace Aws
116117
this->m_status = ReportTaskStatus::Running;
117118
}
118119
}
119-
return AWS_OP_SUCCESS;
120+
return AWS_OP_ERR;
120121
}
121122

122123
void ReportTask::StopTask() noexcept
@@ -131,9 +132,12 @@ namespace Aws
131132
ReportTask::~ReportTask()
132133
{
133134
StopTask();
134-
aws_iotdevice_defender_config_clean_up(m_taskConfig);
135+
if (m_taskConfig)
136+
{
137+
aws_iotdevice_defender_config_clean_up(m_taskConfig);
138+
this->m_taskConfig = nullptr;
139+
}
135140
this->m_owningTask = nullptr;
136-
this->m_taskConfig = nullptr;
137141
this->m_allocator = nullptr;
138142
this->OnTaskCancelled = nullptr;
139143
this->cancellationUserdata = nullptr;

0 commit comments

Comments
 (0)