-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
kill global g_windowManager #13722
kill global g_windowManager #13722
Conversation
xbmc/guilib/GUIComponent.h
Outdated
CGUIWindowManager& GetWindowManager(); | ||
|
||
protected: | ||
std::unique_ptr<CGUIWindowManager> m_pWindowManager; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
I didn't know you'd come to the rescue with a thousand lines of code ;) I'll review this weekend and relocate StereoscopicsManager. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR looks good. I'll port CStereoscopicsManager in the next day or two
xbmc/utils/FileUtils.cpp
Outdated
@@ -53,7 +54,7 @@ bool CFileUtils::DeleteItem(const CFileItemPtr &item, bool force) | |||
if (!item || item->IsParentFolder()) | |||
return false; | |||
|
|||
CGUIDialogYesNo* pDialog = g_windowManager.GetWindow<CGUIDialogYesNo>(WINDOW_DIALOG_YES_NO); | |||
CGUIDialogYesNo* pDialog = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogYesNo>(WINDOW_DIALOG_YES_NO); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@da-anda 014e8a4 shows the tedious tasks we have to do. No fance framework or technology solves those issues. GUI logic has to be removed from lower layers. @garbear more bullet points for your how-to:
|
@@ -78,7 +78,11 @@ namespace XBMCAddon | |||
bool rmdir(const String& path, bool force) | |||
{ | |||
DelayedCallGuard dg; | |||
return (force ? CFileUtils::DeleteItem(path,force) : XFILE::CDirectory::Remove(path)); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
this segfaults on Windows. There are calls to GetWindowManager() from the WM_PAINT event before the CGUIComponent pointer is even initialized. |
@@ -721,7 +722,7 @@ bool CApplication::CreateGUI() | |||
info.iHeight, | |||
info.strMode.c_str()); | |||
|
|||
g_windowManager.Initialize(); | |||
m_pGUI.reset(new CGUIComponent()); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Would it not be better in future to create test builds for all platforms and do some testing (or ask others to test for you) before merging such large changes? Because of this PR I just spent several hours on a messy rebase of my work, that has been ready for merge for weeks but waiting for review, only to find it seg faults. Very unimpressed. |
[win32] fix crash after #13722 + cosmetics
@DaveTBlake killing globals is a thankless task. It takes hours and it's almost guaranteed something will break every time. Nevertheless, it's important that we fight these architectural road blocks. More globals-killing is needed, so keep a lookout for these PRs. Thanks for the understanding. |
@garbear yep, I believe that it is an thankless task, and therefore we should produce something for testing. Don't matter if internal or external. I suggest to trigger a test build and ask kodi members to test it on different platforms. If the test version is public available, I could also ask the userbase or we make a thread in forum.kodi.tv for such critical test builds. |
Well, sorry for the inconvenience but I don't think the trouble was that hard as it seems when reading those complaints. Sorry for the breakage of Windows and PI build and many thanks to @Voyager1 @afedchin @popcornmix for helping out fixing the issues quickly. |
Happy for that @FernetMenta, well done have a cookie etc. Unhappy to have wasted 8 hours of my life, which could have been avoided with a better communication. Unhappy that your response to that is "I don't think the trouble was that hard". Well that is just your opinion. Equally that waste could have been avoided with some very basic platform testing before this extensive PR was merged. Of course testing does not catch everything, but we could at least try. I understand the need for speed to avoid yet more rework, but making test builds available on the mirrors is so easy, and members would use them to test something promptly if asked. |
clients of GUI should check the interface pointer they get from ServiceBroker. GUI won't be mandatory in future version.