X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=Tizen.Uix.VoiceControl%2FInterop%2FInterop.VoiceControlCommand.cs;h=e9d9bc0961746eb8a1617150c9e7efa69f024248;hb=9d2e1ee19cbc07e7a243db283e7bec5ccc6ef0a6;hp=b9ca66e344934606ad9c02f39470c7952bed4d69;hpb=d6fe9308dc5341301655d8c7ff9787682deab50a;p=platform%2Fcore%2Fcsapi%2Fuix-voice-control.git diff --git a/Tizen.Uix.VoiceControl/Interop/Interop.VoiceControlCommand.cs b/Tizen.Uix.VoiceControl/Interop/Interop.VoiceControlCommand.cs index b9ca66e..e9d9bc0 100755 --- a/Tizen.Uix.VoiceControl/Interop/Interop.VoiceControlCommand.cs +++ b/Tizen.Uix.VoiceControl/Interop/Interop.VoiceControlCommand.cs @@ -21,12 +21,12 @@ using Tizen; using Tizen.Uix.VoiceControl; /// -/// Partial Interop Class +/// Partial interop class. /// internal static partial class Interop { /// - /// VoiceControlCommand Interop Class + /// VoiceControlCommand interop class. /// internal static class VoiceControlCommand { @@ -95,14 +95,18 @@ internal static partial class Interop internal sealed class SafeCommandListHandle : SafeHandle { + internal bool _ownership; + public SafeCommandListHandle(IntPtr handle) : base(handle, true) { + _ownership = true; } public SafeCommandListHandle() : base(IntPtr.Zero, true) { + _ownership = true; } public override bool IsInvalid @@ -112,7 +116,7 @@ internal static partial class Interop protected override bool ReleaseHandle() { - if (!IsInvalid) + if (_ownership && !IsInvalid) { Interop.VoiceControl.ErrorCode error = VcCmdListDestroy(this.handle, false); if (error != Interop.VoiceControl.ErrorCode.None)