mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-19 17:49:14 +00:00
UI: Avoid calling libobs functions with null pointers in projectors
This commit is contained in:
parent
099b391e7c
commit
1d7c066cf5
|
@ -19,8 +19,10 @@ OBSProjector::OBSProjector(QWidget *widget, obs_source_t *source_, int monitor,
|
|||
: OBSQTDisplay(widget, Qt::Window), weakSource(OBSGetWeakRef(source_))
|
||||
{
|
||||
OBSSource source = GetSource();
|
||||
destroyedSignal.Connect(obs_source_get_signal_handler(source),
|
||||
"destroy", OBSSourceDestroyed, this);
|
||||
if (source) {
|
||||
destroyedSignal.Connect(obs_source_get_signal_handler(source),
|
||||
"destroy", OBSSourceDestroyed, this);
|
||||
}
|
||||
|
||||
isAlwaysOnTop = config_get_bool(GetGlobalConfig(), "BasicWindow",
|
||||
"ProjectorAlwaysOnTop");
|
||||
|
@ -50,7 +52,10 @@ OBSProjector::OBSProjector(QWidget *widget, obs_source_t *source_, int monitor,
|
|||
else
|
||||
SetMonitor(monitor);
|
||||
|
||||
UpdateProjectorTitle(QT_UTF8(obs_source_get_name(source)));
|
||||
if (source)
|
||||
UpdateProjectorTitle(QT_UTF8(obs_source_get_name(source)));
|
||||
else
|
||||
UpdateProjectorTitle(QString());
|
||||
|
||||
QAction *action = new QAction(this);
|
||||
action->setShortcut(Qt::Key_Escape);
|
||||
|
|
Loading…
Reference in a new issue