Commit 2f7c259f authored by Martin Finkel's avatar Martin Finkel

Core: Fix bad SetDialogHandlers interop crash

videolan/LibVLCSharp#275
parent 5cf4821f
......@@ -211,15 +211,29 @@ namespace LibVLCSharp.Shared
/// <summary>Dialog callbacks to be implemented</summary>
internal readonly struct DialogCallbacks
{
readonly DisplayErrorCallback displayErrorCb;
readonly DisplayLoginCallback displayLoginCb;
readonly DisplayQuestionCallback displayQuestionCb;
readonly DisplayProgressCallback displayProgressCb;
readonly CancelCallback cancelCb;
readonly UpdateProgressCallback updateProgressCb;
internal DialogCallbacks(DisplayErrorCallback displayError, DisplayLoginCallback displayLogin, DisplayQuestionCallback displayQuestion,
DisplayProgressCallback displayProgress, CancelCallback cancel, UpdateProgressCallback updateProgress)
{
DisplayError = Marshal.GetFunctionPointerForDelegate(displayError);
DisplayLogin = Marshal.GetFunctionPointerForDelegate(displayLogin);
DisplayQuestion = Marshal.GetFunctionPointerForDelegate(displayQuestion);
DisplayProgress = Marshal.GetFunctionPointerForDelegate(displayProgress);
Cancel = Marshal.GetFunctionPointerForDelegate(cancel);
UpdateProgress = Marshal.GetFunctionPointerForDelegate(updateProgress);
displayErrorCb = displayError;
displayLoginCb = displayLogin;
displayQuestionCb = displayQuestion;
displayProgressCb = displayProgress;
cancelCb = cancel;
updateProgressCb = updateProgress;
DisplayError = Marshal.GetFunctionPointerForDelegate(displayErrorCb);
DisplayLogin = Marshal.GetFunctionPointerForDelegate(displayLoginCb);
DisplayQuestion = Marshal.GetFunctionPointerForDelegate(displayQuestionCb);
DisplayProgress = Marshal.GetFunctionPointerForDelegate(displayProgressCb);
Cancel = Marshal.GetFunctionPointerForDelegate(cancelCb);
UpdateProgress = Marshal.GetFunctionPointerForDelegate(updateProgressCb);
}
internal readonly IntPtr DisplayError;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment