Skip to content

Commit e2c5313

Browse files
authored
Merge pull request #489 from mtconnect/487_agent_crash
Agent crash when performing current after reloading identical Device.xml file
2 parents 5d1510c + 1efb81b commit e2c5313

File tree

7 files changed

+6
-27
lines changed

7 files changed

+6
-27
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set(AGENT_VERSION_MAJOR 2)
33
set(AGENT_VERSION_MINOR 4)
44
set(AGENT_VERSION_PATCH 0)
5-
set(AGENT_VERSION_BUILD 1)
5+
set(AGENT_VERSION_BUILD 2)
66
set(AGENT_VERSION_RC "")
77

88
# This minimum version is to support Visual Studio 2019 and C++ feature checking and FetchContent

conan/profiles/vs32

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ compiler.runtime=static
88
compiler.runtime_type=Release
99
build_type=Release
1010

11+

conan/profiles/vs32debug

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ arch=x86
77
compiler.runtime=static
88
compiler.runtime_type=Debug
99
build_type=Debug
10+

conan/profiles/vs32shared

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ compiler.runtime=dynamic
88
compiler.runtime_type=Release
99
build_type=Release
1010

11+
1112
[options]
1213
shared=True

conan/profiles/vs64

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ compiler.cppstd=17
66
arch=x86_64
77
compiler.runtime=static
88
compiler.runtime_type=Release
9-
build_type=Release
9+
build_type=Release

conan/profiles/vs64debug

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ arch=x86_64
77
compiler.runtime=static
88
compiler.runtime_type=Debug
99
build_type=Debug
10-

src/mtconnect/agent.cpp

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -568,27 +568,7 @@ namespace mtconnect {
568568
LOG(error) << "Device does not have a name: " << *device->getUuid();
569569
return false;
570570
}
571-
572-
// if different, and revise to new device leaving in place
573-
// the asset changed, removed, and availability data items
574-
ErrorList errors;
575-
if (auto odi = oldDev->getAssetChanged(), ndi = device->getAssetChanged(); odi && !ndi)
576-
device->addDataItem(odi, errors);
577-
if (auto odi = oldDev->getAssetRemoved(), ndi = device->getAssetRemoved(); odi && !ndi)
578-
device->addDataItem(odi, errors);
579-
if (auto odi = oldDev->getAvailability(), ndi = device->getAvailability(); odi && !ndi)
580-
device->addDataItem(odi, errors);
581-
if (auto odi = oldDev->getAssetCount(), ndi = device->getAssetCount(); odi && !ndi)
582-
device->addDataItem(odi, errors);
583-
584-
if (errors.size() > 0)
585-
{
586-
LOG(error) << "Error adding device required data items for " << *device->getUuid() << ':';
587-
for (const auto &e : errors)
588-
LOG(error) << " " << e->what();
589-
return false;
590-
}
591-
571+
592572
verifyDevice(device);
593573
createUniqueIds(device);
594574

@@ -929,9 +909,6 @@ namespace mtconnect {
929909
{
930910
NAMED_SCOPE("Agent::initializeDataItems");
931911

932-
// Grab data from configuration
933-
string time = getCurrentTime(GMT_UV_SEC);
934-
935912
// Initialize the id mapping for the devices and set all data items to UNAVAILABLE
936913
for (auto item : device->getDeviceDataItems())
937914
{

0 commit comments

Comments
 (0)