Skip to content

Commit a0698f9

Browse files
authored
Merge pull request #2070 from matkatz1/development
fix lazy initialization of tagged profiles
2 parents 1cbf38e + b022477 commit a0698f9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/device.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ device::device(std::shared_ptr<context> ctx,
127127
: _context(ctx), _group(group), _is_valid(true),
128128
_device_changed_notifications(device_changed_notifications)
129129
{
130+
_profiles_tags = lazy<std::vector<tagged_profile>>([this]() { return get_profiles_tags(); });
131+
130132
if (_device_changed_notifications)
131133
{
132134
auto cb = new devices_changed_callback_internal([this](rs2_device_list* removed, rs2_device_list* added)
@@ -144,7 +146,6 @@ device::device(std::shared_ptr<context> ctx,
144146
});
145147

146148
_callback_id = _context->register_internal_device_callback({ cb, [](rs2_devices_changed_callback* p) { p->release(); } });
147-
_profiles_tags = lazy<std::vector<tagged_profile>>([this]() { return get_profiles_tags(); });
148149
}
149150
}
150151

0 commit comments

Comments
 (0)