Sometimes when a system is under heavy load CallbackOnCollectedDelegate occur and produce NullReferenceException. The reason is that in the method WkHtmlToPdfConverter._Convert native calls that are invoked in the finally block (wkhtmltopdf_set_error_callback (converter, null), etc.)
do not have time to work on the side of c ++ library before the garbage collector destroys corresponding delegates objects. In particular case it tries to call wkhtmltopdf_int_callback after completion of the WkHtmlToPdfConverter._Convert method that resulted in an error.
Sometimes when a system is under heavy load CallbackOnCollectedDelegate occur and produce NullReferenceException. The reason is that in the method WkHtmlToPdfConverter._Convert native calls that are invoked in the finally block (wkhtmltopdf_set_error_callback (converter, null), etc.)
do not have time to work on the side of c ++ library before the garbage collector destroys corresponding delegates objects. In particular case it tries to call wkhtmltopdf_int_callback after completion of the WkHtmlToPdfConverter._Convert method that resulted in an error.