diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLAuthenticationData.cs | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs index af6be75..fef582e 100644 --- a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs +++ b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs | |||
@@ -59,6 +59,7 @@ namespace OpenSim.Data.MySQL | |||
59 | dbcon.Open(); | 59 | dbcon.Open(); |
60 | Migration m = new Migration(dbcon, Assembly, "AuthStore"); | 60 | Migration m = new Migration(dbcon, Assembly, "AuthStore"); |
61 | m.Update(); | 61 | m.Update(); |
62 | dbcon.Close(); | ||
62 | } | 63 | } |
63 | } | 64 | } |
64 | 65 | ||
@@ -76,27 +77,30 @@ namespace OpenSim.Data.MySQL | |||
76 | { | 77 | { |
77 | cmd.Parameters.AddWithValue("?principalID", principalID.ToString()); | 78 | cmd.Parameters.AddWithValue("?principalID", principalID.ToString()); |
78 | 79 | ||
79 | IDataReader result = cmd.ExecuteReader(); | 80 | using(IDataReader result = cmd.ExecuteReader()) |
80 | |||
81 | if (result.Read()) | ||
82 | { | 81 | { |
83 | ret.PrincipalID = principalID; | 82 | if(result.Read()) |
83 | { | ||
84 | ret.PrincipalID = principalID; | ||
84 | 85 | ||
85 | CheckColumnNames(result); | 86 | CheckColumnNames(result); |
86 | 87 | ||
87 | foreach (string s in m_ColumnNames) | 88 | foreach(string s in m_ColumnNames) |
88 | { | 89 | { |
89 | if (s == "UUID") | 90 | if(s == "UUID") |
90 | continue; | 91 | continue; |
91 | 92 | ||
92 | ret.Data[s] = result[s].ToString(); | 93 | ret.Data[s] = result[s].ToString(); |
93 | } | 94 | } |
94 | 95 | ||
95 | return ret; | 96 | dbcon.Close(); |
96 | } | 97 | return ret; |
97 | else | 98 | } |
98 | { | 99 | else |
99 | return null; | 100 | { |
101 | dbcon.Close(); | ||
102 | return null; | ||
103 | } | ||
100 | } | 104 | } |
101 | } | 105 | } |
102 | } | 106 | } |