Skip to content

Commit 2cac88c

Browse files
committed
close resource when rebuilding in module reconfigure
1 parent 3d9579c commit 2cac88c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/viam/sdk/module/service.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ struct ModuleService::ServiceImpl : viam::module::v1::ModuleService::Service {
115115
Registry::get().lookup_model(cfg.name());
116116
if (reg) {
117117
try {
118+
res->close();
118119
const std::shared_ptr<Resource> res = reg->construct_resource(deps, cfg);
119120
manager->replace_one(cfg.resource_name(), res);
120121
} catch (const std::exception& exc) {

0 commit comments

Comments
 (0)