Fix an initialization issue in ie_core_create (#6489)

* Fix InferenceEngine::Core initialization. Previously IE::Core was
  default constructed first, then overwritten by another instance.
  This causes problems if the library user attempts to opt-out of the
  default "plugins.xml" plugin loading mechanism.
This commit is contained in:
Daniel Kiss 2021-07-05 16:53:18 +02:00 committed by GitHub
parent 72db14bf6e
commit 92cec2367b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -235,9 +235,8 @@ IEStatusCode ie_core_create(const char *xml_config_file, ie_core_t **core) {
IEStatusCode status = IEStatusCode::OK;
try {
std::unique_ptr<ie_core_t> tmp(new ie_core_t);
tmp->object = IE::Core(xml_config_file);
*core = tmp.release();
auto object = IE::Core(xml_config_file);
*core = new ie_core_t { std::move(object) };
} CATCH_IE_EXCEPTIONS
return status;