Declined
Last Updated: 25 Oct 2023 08:58 by ADMIN
Jose Ramon
Created on: 17 Oct 2023 05:49
Category: RichTextBox
Type: Bug Report
1
RichTextBox: The RadDocument.MailMerge() function crashes a service after the mail merge is run several times
The RadDocument.MailMerge() function crashes a service after the mail merge is ran several times
1 comment
ADMIN
Vladimir Stoyanov
Posted on: 25 Oct 2023 08:58

The root cause of this crash was the instantiation of a Dispatcher on multiple threads (2000-3000) without shutting down the Dispatcher after the work for the specific thread is done. With this in mind, when creating threads that work with DependencyObjects, make sure that the Dispatcher is shutdown after the work for the thread is finished:

var thread = new Thread(() =>
{
     // This creates a Dispatcher artificially, however it will also be created if any DependencyObject is instantiated
     var disp = Dispatcher.CurrentDispatcher;

    // This makes sure to shut down the Dispatcher for that thread after the work is don
    Dispatcher.CurrentDispatcher.InvokeShutdown();
});

Regards,
Vladimir Stoyanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.