mirror of
https://github.com/Aitum/obs-aitum-multistream.git
synced 2024-11-21 18:02:33 +01:00
Fix crash vertical outputs dereferenced
This commit is contained in:
parent
6c4d065cb3
commit
ba1e950e63
@ -430,6 +430,7 @@ MultistreamDock::~MultistreamDock()
|
|||||||
obs_service_release(service);
|
obs_service_release(service);
|
||||||
}
|
}
|
||||||
outputs.clear();
|
outputs.clear();
|
||||||
|
obs_data_array_release(vertical_outputs);
|
||||||
obs_data_release(current_config);
|
obs_data_release(current_config);
|
||||||
obs_frontend_remove_event_callback(frontend_event, this);
|
obs_frontend_remove_event_callback(frontend_event, this);
|
||||||
multistream_dock = nullptr;
|
multistream_dock = nullptr;
|
||||||
@ -948,37 +949,26 @@ void MultistreamDock::LoadVerticalOutputs(bool firstLoad)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto outputs = (obs_data_array_t *)calldata_ptr(&cd, "outputs");
|
if (vertical_outputs)
|
||||||
|
obs_data_array_release(vertical_outputs);
|
||||||
|
vertical_outputs = (obs_data_array_t *)calldata_ptr(&cd, "outputs");
|
||||||
|
|
||||||
calldata_free(&cd);
|
calldata_free(&cd);
|
||||||
auto count = obs_data_array_count(outputs);
|
auto count = obs_data_array_count(vertical_outputs);
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
while (auto item = verticalCanvasOutputLayout->itemAt(idx)) {
|
while (auto item = verticalCanvasOutputLayout->itemAt(idx)) {
|
||||||
auto streamGroup = item->widget();
|
auto streamGroup = item->widget();
|
||||||
auto name = streamGroup->objectName();
|
|
||||||
bool found = false;
|
|
||||||
for (size_t i = 0; i < count; i++) {
|
|
||||||
auto item = obs_data_array_item(outputs, i);
|
|
||||||
if (QString::fromUtf8(obs_data_get_string(item, "name")) == name) {
|
|
||||||
found = true;
|
|
||||||
}
|
|
||||||
obs_data_release(item);
|
|
||||||
}
|
|
||||||
if (!found) {
|
|
||||||
verticalCanvasOutputLayout->removeWidget(streamGroup);
|
verticalCanvasOutputLayout->removeWidget(streamGroup);
|
||||||
RemoveWidget(streamGroup);
|
RemoveWidget(streamGroup);
|
||||||
} else {
|
|
||||||
idx++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
obs_data_array_enum(
|
obs_data_array_enum(
|
||||||
outputs,
|
vertical_outputs,
|
||||||
[](obs_data_t *data, void *param) {
|
[](obs_data_t *data, void *param) {
|
||||||
auto d = (MultistreamDock *)param;
|
auto d = (MultistreamDock *)param;
|
||||||
d->LoadOutput(data, true);
|
d->LoadOutput(data, true);
|
||||||
},
|
},
|
||||||
this);
|
this);
|
||||||
obs_data_array_release(outputs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MultistreamDock::storeMainStreamEncoders()
|
void MultistreamDock::storeMainStreamEncoders()
|
||||||
|
@ -35,6 +35,7 @@ private:
|
|||||||
std::vector<video_t *> oldVideo;
|
std::vector<video_t *> oldVideo;
|
||||||
|
|
||||||
std::vector<std::tuple<std::string, obs_output_t *, QPushButton *>> outputs;
|
std::vector<std::tuple<std::string, obs_output_t *, QPushButton *>> outputs;
|
||||||
|
obs_data_array_t *vertical_outputs = nullptr;
|
||||||
bool exiting = false;
|
bool exiting = false;
|
||||||
|
|
||||||
void LoadSettingsFile();
|
void LoadSettingsFile();
|
||||||
|
Loading…
Reference in New Issue
Block a user