* Properly dispose of the reader after readAttachments() has finished with it in the Mysql User data manager

0.6.0-stable
Justin Clarke Casey 2008-08-18 21:18:59 +00:00
parent 9650632cd1
commit 9e6b38078a
1 changed files with 3 additions and 2 deletions

View File

@ -660,13 +660,12 @@ namespace OpenSim.Data.MySQL
return appearance; return appearance;
} }
// Read attachment list from data reader // Read attachment list from data reader
public Hashtable readAttachments(IDataReader r) public Hashtable readAttachments(IDataReader r)
{ {
Hashtable ret = new Hashtable(); Hashtable ret = new Hashtable();
while(r.Read()) while (r.Read())
{ {
int attachpoint = Convert.ToInt32(r["attachpoint"]); int attachpoint = Convert.ToInt32(r["attachpoint"]);
if(ret.ContainsKey(attachpoint)) if(ret.ContainsKey(attachpoint))
@ -677,6 +676,8 @@ namespace OpenSim.Data.MySQL
ret.Add(attachpoint, item); ret.Add(attachpoint, item);
} }
r.Close();
return ret; return ret;
} }