1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-07-07 04:19:25 +02:00

Fixed: Another IDisposable leak when lazy loading properties.

This commit is contained in:
Taloth Saldono 2018-12-23 14:42:50 +01:00 committed by Leonardo Galli
parent cd520b0341
commit 3ef224ed1d
2 changed files with 4 additions and 2 deletions

0
debian/rules vendored Executable file → Normal file
View File

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Data.Common; using System.Data.Common;
@ -91,9 +91,11 @@ private void PrepareLazyLoadedProperties(object ent)
Type entType = ent.GetType(); Type entType = ent.GetType();
if (_repos.Relationships.ContainsKey(entType)) if (_repos.Relationships.ContainsKey(entType))
{ {
var provider = _db.ProviderFactory;
var connectionString = _db.ConnectionString;
Func<IDataMapper> dbCreate = () => Func<IDataMapper> dbCreate = () =>
{ {
var db = new DataMapper(_db.ProviderFactory, _db.ConnectionString); var db = new DataMapper(provider, connectionString);
db.SqlMode = SqlModes.Text; db.SqlMode = SqlModes.Text;
return db; return db;
}; };