mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-05-24 16:28:07 -04:00
UI: Use std::shared_ptr instead of QSharedPointer
Also use std::weak_ptr instead of QWeakPointer as needed. Qt has been porting QSharedPointer and QWeakPointer to std::shared_ptr and std::weak_ptr respectively. QSharedPointer is apparently 2x slower than std::shared_ptr. References: * https://bugreports.qt.io/browse/QTBUG-109570 * https://codereview.qt-project.org/c/qt/qtbase/+/359678 * https://codereview.qt-project.org/c/qt/qtgrpc/+/447780 * https://codereview.qt-project.org/c/qt/qtbase/+/450134 * https://codereview.qt-project.org/c/qt/qttools/+/450776 * https://codereview.qt-project.org/c/qt/qttools/+/450777 * https://codereview.qt-project.org/q/QSharedPointer
This commit is contained in:
@@ -10487,7 +10487,7 @@ void OBSBasic::AddDockWidget(QDockWidget *dock, Qt::DockWidgetArea area,
|
||||
#endif
|
||||
|
||||
extraDockNames.push_back(dock->objectName());
|
||||
extraDocks.push_back(QSharedPointer<QDockWidget>(dock));
|
||||
extraDocks.push_back(std::shared_ptr<QDockWidget>(dock));
|
||||
}
|
||||
|
||||
void OBSBasic::RemoveDockWidget(const QString &name)
|
||||
@@ -10495,7 +10495,7 @@ void OBSBasic::RemoveDockWidget(const QString &name)
|
||||
if (extraDockNames.contains(name)) {
|
||||
int idx = extraDockNames.indexOf(name);
|
||||
extraDockNames.removeAt(idx);
|
||||
extraDocks[idx].clear();
|
||||
extraDocks[idx].reset();
|
||||
extraDocks.removeAt(idx);
|
||||
} else if (extraCustomDockNames.contains(name)) {
|
||||
int idx = extraCustomDockNames.indexOf(name);
|
||||
|
||||
Reference in New Issue
Block a user