Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion framework/extensions/internal/extensionsprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ void ExtensionsProvider::reloadExtensions()
//! NOTE Without this, reloading picks up a plugin's manifest but keeps
//! running the code the engine compiled the first time, so edits to a
//! plugin only take effect after a restart.
extensionsUiEngine()->clearComponentCache();
//! A provider created with the global context (e.g. to scan manifests before
//! any window exists) has no UI engine, so there is nothing to clear.
const modularity::ContextPtr& ctx = iocContext();
if (ctx && ctx->id > 0) {
extensionsUiEngine()->clearComponentCache();
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this way is better, it's clearer

if (extensionsUiEngine) {
     extensionsUiEngine()->clearComponentCache();
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's no bool operator on InjectBase and if we want to use the call form then we gonna hit the asserts on ctx->id > 0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes, you're right.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But something isn't right here :)
ExtensionsProvider itself is also contextual.
How does it happen that it gets created, yet extensionsUiEngine doesn't?


extensionsRegister()->reload();
}
Expand Down