Inspector: Don't allow to inspect Inspector itself

The Inspector hangs when user tries to do that.
This commit is contained in:
Maciej Zygmanowski 2021-04-20 14:40:37 +02:00 committed by Andreas Kling
parent 5338708091
commit 899698c317

View file

@ -111,6 +111,11 @@ int main(int argc, char** argv)
return 1;
}
if (pid == getpid()) {
GUI::MessageBox::show(window, "Cannot inspect Inspector itself!", "Error", GUI::MessageBox::Type::Error);
return 1;
}
auto all_processes = Core::ProcessStatisticsReader::get_all();
for (auto& it : all_processes.value()) {
if (it.value.pid != pid)