Skip to content

Commit

Permalink
fix thread leak in vlc player
Browse files Browse the repository at this point in the history
  • Loading branch information
ispysoftware committed Nov 8, 2021
1 parent 33fcaf4 commit 2a7f9ac
Show file tree
Hide file tree
Showing 10 changed files with 819 additions and 780 deletions.
252 changes: 126 additions & 126 deletions App.config

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion PlayerVLC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,12 @@ public static void Execute(Action action)

private void Player_FormClosing(object sender, FormClosingEventArgs e)
{

videoView1.MediaPlayer.Media.Dispose();
videoView1.MediaPlayer.Media = null;
videoView1.MediaPlayer?.Dispose();
videoView1.MediaPlayer = null;
videoView1.Dispose();
videoView1 = null;
}

private void tbSpeed_Scroll(object sender, EventArgs e)
Expand Down
2 changes: 1 addition & 1 deletion Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1,194 changes: 597 additions & 597 deletions Service References/OnvifServices/Reference.cs

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions Web References/Reporting/Reference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace iSpyApplication.Reporting {


/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4161.0")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="ReportingSoap", Namespace="http://tempuri.org/")]
Expand Down Expand Up @@ -294,23 +294,23 @@ private bool IsLocalFileSystemWebService(string url) {
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4161.0")]
public delegate void LogApplicationExceptionCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4161.0")]
public delegate void LogUsageCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4161.0")]
public delegate void AddCameraCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4161.0")]
public delegate void AddCamera2CompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1586.0")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4161.0")]
public delegate void SendFeedbackCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
}

Expand Down
82 changes: 41 additions & 41 deletions Web References/iSpyWS/Reference.cs

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions iSpy.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>9.0.30729</ProductVersion>
Expand Down Expand Up @@ -35,7 +35,7 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<OldToolsVersion>3.5</OldToolsVersion>
<ApplicationManifest>app.manifest</ApplicationManifest>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
Expand Down Expand Up @@ -2965,6 +2965,12 @@
<ItemGroup>
<WCFMetadataStorage Include="Service References\OnvifServices\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="D:\Projects\pixiv\src\sdk\dotnet\webrtc\webrtc.csproj">
<Project>{99f347cc-8526-4cc0-9e64-f2aaf2066782}</Project>
<Name>webrtc</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
Expand Down
28 changes: 28 additions & 0 deletions iSpy.sln
Original file line number Diff line number Diff line change
Expand Up @@ -21,52 +21,80 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WixCA", "Wix\WixCA\WixCA.cs
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iSpyMonitor", "iSpyMonitor\iSpyMonitor.csproj", "{949FACB4-C156-4EFE-93B4-654CA8794DE5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "webrtc", "D:\Projects\pixiv\src\sdk\dotnet\webrtc\webrtc.csproj", "{99F347CC-8526-4CC0-9E64-F2AAF2066782}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F4799C73-DEE9-48F2-B626-32149CC30976}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F4799C73-DEE9-48F2-B626-32149CC30976}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F4799C73-DEE9-48F2-B626-32149CC30976}.Debug|x64.ActiveCfg = Debug|x64
{F4799C73-DEE9-48F2-B626-32149CC30976}.Debug|x64.Build.0 = Debug|x64
{F4799C73-DEE9-48F2-B626-32149CC30976}.Debug|x86.ActiveCfg = Debug|x86
{F4799C73-DEE9-48F2-B626-32149CC30976}.Debug|x86.Build.0 = Debug|x86
{F4799C73-DEE9-48F2-B626-32149CC30976}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F4799C73-DEE9-48F2-B626-32149CC30976}.Release|Any CPU.Build.0 = Release|Any CPU
{F4799C73-DEE9-48F2-B626-32149CC30976}.Release|x64.ActiveCfg = Release|x64
{F4799C73-DEE9-48F2-B626-32149CC30976}.Release|x64.Build.0 = Release|x64
{F4799C73-DEE9-48F2-B626-32149CC30976}.Release|x86.ActiveCfg = Release|x86
{F4799C73-DEE9-48F2-B626-32149CC30976}.Release|x86.Build.0 = Release|x86
{5783B777-EF53-4651-AD1B-F4F3C105D3F9}.Debug|Any CPU.ActiveCfg = Debug|x86
{5783B777-EF53-4651-AD1B-F4F3C105D3F9}.Debug|x64.ActiveCfg = Debug|x64
{5783B777-EF53-4651-AD1B-F4F3C105D3F9}.Debug|x64.Build.0 = Debug|x64
{5783B777-EF53-4651-AD1B-F4F3C105D3F9}.Debug|x86.ActiveCfg = Debug|x86
{5783B777-EF53-4651-AD1B-F4F3C105D3F9}.Debug|x86.Build.0 = Debug|x86
{5783B777-EF53-4651-AD1B-F4F3C105D3F9}.Release|Any CPU.ActiveCfg = Release|x86
{5783B777-EF53-4651-AD1B-F4F3C105D3F9}.Release|x64.ActiveCfg = Release|x64
{5783B777-EF53-4651-AD1B-F4F3C105D3F9}.Release|x64.Build.0 = Release|x64
{5783B777-EF53-4651-AD1B-F4F3C105D3F9}.Release|x86.ActiveCfg = Release|x86
{5783B777-EF53-4651-AD1B-F4F3C105D3F9}.Release|x86.Build.0 = Release|x86
{833F6888-A557-48A9-83A8-FA6D0BF691A3}.Debug|Any CPU.ActiveCfg = Debug|x86
{833F6888-A557-48A9-83A8-FA6D0BF691A3}.Debug|x64.ActiveCfg = Debug|x64
{833F6888-A557-48A9-83A8-FA6D0BF691A3}.Debug|x64.Build.0 = Debug|x64
{833F6888-A557-48A9-83A8-FA6D0BF691A3}.Debug|x86.ActiveCfg = Debug|x86
{833F6888-A557-48A9-83A8-FA6D0BF691A3}.Debug|x86.Build.0 = Debug|x86
{833F6888-A557-48A9-83A8-FA6D0BF691A3}.Release|Any CPU.ActiveCfg = Release|x86
{833F6888-A557-48A9-83A8-FA6D0BF691A3}.Release|x64.ActiveCfg = Release|x64
{833F6888-A557-48A9-83A8-FA6D0BF691A3}.Release|x64.Build.0 = Release|x64
{833F6888-A557-48A9-83A8-FA6D0BF691A3}.Release|x86.ActiveCfg = Release|x86
{833F6888-A557-48A9-83A8-FA6D0BF691A3}.Release|x86.Build.0 = Release|x86
{27624167-C034-4349-B30F-CD18934D8737}.Debug|Any CPU.ActiveCfg = Debug|x86
{27624167-C034-4349-B30F-CD18934D8737}.Debug|x64.ActiveCfg = Debug|x86
{27624167-C034-4349-B30F-CD18934D8737}.Debug|x64.Build.0 = Debug|x86
{27624167-C034-4349-B30F-CD18934D8737}.Debug|x86.ActiveCfg = Debug|x86
{27624167-C034-4349-B30F-CD18934D8737}.Debug|x86.Build.0 = Debug|x86
{27624167-C034-4349-B30F-CD18934D8737}.Release|Any CPU.ActiveCfg = Release|x86
{27624167-C034-4349-B30F-CD18934D8737}.Release|x64.ActiveCfg = Release|x86
{27624167-C034-4349-B30F-CD18934D8737}.Release|x64.Build.0 = Release|x86
{27624167-C034-4349-B30F-CD18934D8737}.Release|x86.ActiveCfg = Release|x86
{27624167-C034-4349-B30F-CD18934D8737}.Release|x86.Build.0 = Release|x86
{949FACB4-C156-4EFE-93B4-654CA8794DE5}.Debug|Any CPU.ActiveCfg = Debug|x86
{949FACB4-C156-4EFE-93B4-654CA8794DE5}.Debug|x64.ActiveCfg = Debug|x86
{949FACB4-C156-4EFE-93B4-654CA8794DE5}.Debug|x86.ActiveCfg = Debug|x86
{949FACB4-C156-4EFE-93B4-654CA8794DE5}.Debug|x86.Build.0 = Debug|x86
{949FACB4-C156-4EFE-93B4-654CA8794DE5}.Release|Any CPU.ActiveCfg = Release|x86
{949FACB4-C156-4EFE-93B4-654CA8794DE5}.Release|x64.ActiveCfg = Release|x86
{949FACB4-C156-4EFE-93B4-654CA8794DE5}.Release|x86.ActiveCfg = Release|x86
{949FACB4-C156-4EFE-93B4-654CA8794DE5}.Release|x86.Build.0 = Release|x86
{99F347CC-8526-4CC0-9E64-F2AAF2066782}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{99F347CC-8526-4CC0-9E64-F2AAF2066782}.Debug|Any CPU.Build.0 = Debug|Any CPU
{99F347CC-8526-4CC0-9E64-F2AAF2066782}.Debug|x64.ActiveCfg = Debug|Any CPU
{99F347CC-8526-4CC0-9E64-F2AAF2066782}.Debug|x64.Build.0 = Debug|Any CPU
{99F347CC-8526-4CC0-9E64-F2AAF2066782}.Debug|x86.ActiveCfg = Debug|Any CPU
{99F347CC-8526-4CC0-9E64-F2AAF2066782}.Debug|x86.Build.0 = Debug|Any CPU
{99F347CC-8526-4CC0-9E64-F2AAF2066782}.Release|Any CPU.ActiveCfg = Release|Any CPU
{99F347CC-8526-4CC0-9E64-F2AAF2066782}.Release|Any CPU.Build.0 = Release|Any CPU
{99F347CC-8526-4CC0-9E64-F2AAF2066782}.Release|x64.ActiveCfg = Release|Any CPU
{99F347CC-8526-4CC0-9E64-F2AAF2066782}.Release|x64.Build.0 = Release|Any CPU
{99F347CC-8526-4CC0-9E64-F2AAF2066782}.Release|x86.ActiveCfg = Release|Any CPU
{99F347CC-8526-4CC0-9E64-F2AAF2066782}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
10 changes: 5 additions & 5 deletions packages.config
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BouncyCastle" version="1.8.5" targetFramework="net45" />
<package id="FFmpeg.AutoGen" version="4.2.2.1" targetFramework="net45" />
<package id="FFmpeg.AutoGen" version="4.2.2.1" targetFramework="net45" requireReinstallation="true" />
<package id="FlickrNet" version="3.26.0" targetFramework="net45" />
<package id="Google.Apis" version="1.44.1" targetFramework="net45" />
<package id="Google.Apis.Auth" version="1.44.1" targetFramework="net45" />
<package id="Google.Apis.Core" version="1.44.1" targetFramework="net45" />
<package id="Google.Apis.Drive.v3" version="1.44.1.1888" targetFramework="net45" />
<package id="Google.Apis.YouTube.v3" version="1.44.1.1869" targetFramework="net45" />
<package id="LibVLCSharp" version="3.4.5" targetFramework="net45" />
<package id="LibVLCSharp" version="3.4.5" targetFramework="net45" requireReinstallation="true" />
<package id="LibVLCSharp.WinForms" version="3.4.5" targetFramework="net45" />
<package id="log4net" version="2.0.12" targetFramework="net45" />
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net45" />
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net4" />
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="net45" />
<package id="Microsoft.Net.Http" version="2.2.29" targetFramework="net45" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net45" />
<package id="RestSharp" version="105.2.3" targetFramework="net45" />
<package id="RestSharp" version="105.2.3" targetFramework="net45" requireReinstallation="true" />
<package id="SharpDX" version="4.2.0" targetFramework="net45" />
<package id="SharpDX.DirectInput" version="4.2.0" targetFramework="net45" />
<package id="System.Net.Http" version="4.3.4" targetFramework="net45" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net45" />
<package id="System.Net.Http" version="4.3.4" targetFramework="net45" requireReinstallation="true" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net45" requireReinstallation="true" />
<package id="WebSocketSharp-netstandard" version="1.0.1" targetFramework="net45" />
<package id="Zlib.Portable" version="1.11.0" targetFramework="net4" />
<package id="Zlib.Portable.Signed" version="1.11.0" targetFramework="net45" />
Expand Down

1 comment on commit 2a7f9ac

@mfkl
Copy link

@mfkl mfkl commented on 2a7f9ac Nov 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI videolan/libvlcsharp#205

videoView1.MediaPlayer.Media

Sadly increments the native ref counter. We are looking in way to fix this. As a workaround in the meantime, you should keep a reference to your media and dispose it as soon as you can (e.g. when its been set). Or if you need to call the property above, call dispose twice.

Please sign in to comment.