ONI contexts should include an INVALID state in run_state, checked as usual, set when a call to oni_init_ctx fails. This will force the destruction of any invalid context instead of enabling the possibility of calling init twice, which could result in leaks.
Adittionally, calling oni_set_opt for ONI_OPT_BLOCKREADSIZE or ONI_OPT_BLOCKWRITESIZE when run_state == RUNNING should result in an error.
ONI contexts should include an
INVALID
state inrun_state
, checked as usual, set when a call tooni_init_ctx
fails. This will force the destruction of any invalid context instead of enabling the possibility of calling init twice, which could result in leaks.Adittionally, calling
oni_set_opt
forONI_OPT_BLOCKREADSIZE
orONI_OPT_BLOCKWRITESIZE
whenrun_state == RUNNING
should result in an error.