mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-13 14:19:12 +00:00
Ensure CimSession is properly disposed.
This commit is contained in:
parent
cc8f4f8a11
commit
31c36afc4c
1 changed files with 6 additions and 4 deletions
|
@ -93,11 +93,13 @@ namespace Ryujinx.Common.SystemInfo
|
|||
{
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
{
|
||||
var session = CimSession.Create(null);
|
||||
var instances = session.QueryInstances(@"root\cimv2", "WQL", "SELECT NumberOfCores FROM Win32_Processor");
|
||||
foreach (CimInstance instance in instances)
|
||||
using (var session = CimSession.Create(null))
|
||||
{
|
||||
coreCount = int.Parse(instance.CimInstanceProperties["NumberOfCores"].Value.ToString());
|
||||
var instances = session.QueryInstances(@"root\cimv2", "WQL", "SELECT NumberOfCores FROM Win32_Processor");
|
||||
foreach (CimInstance instance in instances)
|
||||
{
|
||||
coreCount = int.Parse(instance.CimInstanceProperties["NumberOfCores"].Value.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||
|
|
Loading…
Reference in a new issue