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 ...@@ -211,15 +211,29 @@ namespace LibVLCSharp.Shared
/// <summary>Dialog callbacks to be implemented</summary> /// <summary>Dialog callbacks to be implemented</summary>
internal readonly struct DialogCallbacks 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, internal DialogCallbacks(DisplayErrorCallback displayError, DisplayLoginCallback displayLogin, DisplayQuestionCallback displayQuestion,
DisplayProgressCallback displayProgress, CancelCallback cancel, UpdateProgressCallback updateProgress) DisplayProgressCallback displayProgress, CancelCallback cancel, UpdateProgressCallback updateProgress)
{ {
DisplayError = Marshal.GetFunctionPointerForDelegate(displayError); displayErrorCb = displayError;
DisplayLogin = Marshal.GetFunctionPointerForDelegate(displayLogin); displayLoginCb = displayLogin;
DisplayQuestion = Marshal.GetFunctionPointerForDelegate(displayQuestion); displayQuestionCb = displayQuestion;
DisplayProgress = Marshal.GetFunctionPointerForDelegate(displayProgress); displayProgressCb = displayProgress;
Cancel = Marshal.GetFunctionPointerForDelegate(cancel); cancelCb = cancel;
UpdateProgress = Marshal.GetFunctionPointerForDelegate(updateProgress); 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; 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