Skip to content

Commit bc09d94

Browse files
committed
Allow controlPanel() calls before init()
Fixes #184
1 parent 1a03bcf commit bc09d94

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/flexasio/FlexASIO/cflexasio.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "cflexasio.h"
22

3+
#include "control_panel.h"
34
#include "flexasio.h"
45
#include "flexasio.rc.h"
56
#include "flexasio_h.h"
@@ -121,7 +122,10 @@ namespace flexasio {
121122
}
122123

123124
ASIOError controlPanel() throw() final {
124-
return EnterWithMethod("controlPanel()", &FlexASIO::ControlPanel);
125+
return Enter("controlPanel()", [&] {
126+
if (!flexASIO.has_value()) OpenControlPanel(NULL); // https://github.com/dechamps/FlexASIO/issues/184
127+
flexASIO->ControlPanel();
128+
});
125129
}
126130
ASIOError future(long selector, void *) throw() final {
127131
return Enter("future()", [&] {

0 commit comments

Comments
 (0)