WkHtmlToXSharp icon indicating copy to clipboard operation
WkHtmlToXSharp copied to clipboard

CallbackOnCollectedDelegate MDA

Open ilyazolotarov opened this issue 8 years ago • 1 comments

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.

ilyazolotarov avatar Nov 15 '16 09:11 ilyazolotarov

Hi,

Do you have any proposed fix, or any way of reproducing the issue?

Regards Pablo

Sent from my iPhone

On 15 Nov 2016, at 10:29, ilyazolotarov [email protected] wrote:

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.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

pruiz avatar Nov 15 '16 10:11 pruiz