-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
Description
I ran into the problem that when a call to load_image failed, subsequent calls (with images Devil normally loads without a problem) would also fail for no apparent reason.
The problem seems to be that load_image may push multiple errors codes onto Devil's error stack (in my case there where around seven), but the error_check function calls IL.GetError() only once and so only pops one code of the stack.
The next time error_check is run it will raise an exception even if the previous operation was successful as there are still errors remaining on the stack.
As a workaround I clear the stack manually, by simply calling IL.GetError() until IL::NO_ERROR is returned.