mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-10-27 08:18:50 -04:00
UI: Remove unnecessary shared_ptr allocations
Not sure why these were separate allocations -- the data will be preserved just fine when copying the structure without being separate allocations
This commit is contained in:
1 parent
0c4b3816de
commit
2364dfd0ef
3 files changed
+5
-8
No files matched your search
@@ -9062,10 +9062,8 @@ void OBSBasic::on_actionCopySource_triggered()
|
||||
|
||||
SourceCopyInfo copyInfo;
|
||||
copyInfo.weak_source = OBSGetWeakRef(source);
|
||||
copyInfo.transform = std::make_shared<obs_transform_info>();
|
||||
obs_sceneitem_get_info(item, copyInfo.transform.get());
|
||||
copyInfo.crop = std::make_shared<obs_sceneitem_crop>();
|
||||
obs_sceneitem_get_crop(item, copyInfo.crop.get());
|
||||
obs_sceneitem_get_info(item, ©Info.transform);
|
||||
obs_sceneitem_get_crop(item, ©Info.crop);
|
||||
copyInfo.visible = obs_sceneitem_visible(item);
|
||||
|
||||
clipboard.push_back(copyInfo);
|
||||
|
||||
@@ -92,8 +92,8 @@ struct SavedProjectorInfo {
|
||||
struct SourceCopyInfo {
|
||||
OBSWeakSource weak_source;
|
||||
bool visible;
|
||||
std::shared_ptr<obs_sceneitem_crop> crop;
|
||||
std::shared_ptr<obs_transform_info> transform;
|
||||
obs_sceneitem_crop crop;
|
||||
obs_transform_info transform;
|
||||
};
|
||||
|
||||
struct QuickTransition {
|
||||
|
||||
@@ -431,6 +431,5 @@ void OBSBasicSourceSelect::SourcePaste(SourceCopyInfo &info, bool dup)
|
||||
if (!source)
|
||||
return;
|
||||
|
||||
AddExisting(source, info.visible, dup, info.transform.get(),
|
||||
info.crop.get());
|
||||
AddExisting(source, info.visible, dup, &info.transform, &info.crop);
|
||||
}
|
||||
Reference in new issue
Block a user