mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-22 03:40:30 +00:00
GL: refuse multiple init
This commit is contained in:
committed by
Martin Pulec
parent
1846029eb9
commit
ebc6cc4452
@@ -409,11 +409,13 @@ static void gl_load_splashscreen(struct state_gl *s)
|
||||
|
||||
static void * display_gl_init(struct module *parent, const char *fmt, unsigned int flags) {
|
||||
UNUSED(flags);
|
||||
if (gl) {
|
||||
LOG(LOG_LEVEL_ERROR) << "Multiple instances of GL display is disallowed!\n";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
struct state_gl *s = new state_gl(parent);
|
||||
|
||||
/* GLUT callbacks take only some arguments so we need static variable */
|
||||
gl = s;
|
||||
|
||||
// parse parameters
|
||||
if (fmt != NULL) {
|
||||
if (strcmp(fmt, "help") == 0) {
|
||||
@@ -504,6 +506,9 @@ static void * display_gl_init(struct module *parent, const char *fmt, unsigned i
|
||||
|
||||
gl_load_splashscreen(s);
|
||||
|
||||
/* GLUT callbacks take only some arguments so we need static variable */
|
||||
gl = s;
|
||||
|
||||
return (void*)s;
|
||||
}
|
||||
|
||||
@@ -1702,6 +1707,8 @@ static void display_gl_done(void *state)
|
||||
spout_sender_unregister(s->syphon_spout);
|
||||
#endif
|
||||
}
|
||||
|
||||
gl = nullptr;
|
||||
|
||||
delete s;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user