Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CG REMOVE should destruct html producer #1320

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/modules/html/html.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,10 @@ class cef_task : public CefTask
IMPLEMENT_REFCOUNTING(cef_task);
};

void invoke(const std::function<void()>& func) { begin_invoke(func).get(); }
void invoke(const std::function<void()>& func) {
if (g_cef_executor != nullptr)
begin_invoke(func).get();
}

std::future<void> begin_invoke(const std::function<void()>& func)
{
Expand Down
1 change: 0 additions & 1 deletion src/modules/html/producer/html_producer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,6 @@ class html_client
auto name = message->GetName().ToString();

if (name == REMOVE_MESSAGE_NAME) {
// TODO fully remove producer
this->close();

{
Expand Down
5 changes: 5 additions & 0 deletions src/protocol/amcp/AMCPCommandsImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,11 @@ std::wstring cg_remove_command(command_context& ctx)
int layer = std::stoi(ctx.parameters.at(0));
get_expected_cg_proxy(ctx)->remove(layer);

auto producer = spl::make_shared_ptr(
ctx.channel.channel->stage().foreground(ctx.layer_index(core::cg_proxy::DEFAULT_LAYER)).get());
if (0 == producer->name().compare(L"html"))
ctx.channel.channel->stage().clear(ctx.layer_index(core::cg_proxy::DEFAULT_LAYER));

return L"202 CG OK\r\n";
}

Expand Down