diff options
author | UbitUmarov | 2017-05-06 21:43:22 +0100 |
---|---|---|
committer | UbitUmarov | 2017-05-06 21:43:22 +0100 |
commit | c57215687f6ab0a9585c5331edc2da89a88b8a28 (patch) | |
tree | b392c3a21531baf4c822d03db3e1d03e303e494a /OpenSim/Data/MySQL/MySQLAuthenticationData.cs | |
parent | don't hold dbconn longer than necessart (diff) | |
download | opensim-SC-c57215687f6ab0a9585c5331edc2da89a88b8a28.zip opensim-SC-c57215687f6ab0a9585c5331edc2da89a88b8a28.tar.gz opensim-SC-c57215687f6ab0a9585c5331edc2da89a88b8a28.tar.bz2 opensim-SC-c57215687f6ab0a9585c5331edc2da89a88b8a28.tar.xz |
a few more changes on mysql
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLAuthenticationData.cs')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLAuthenticationData.cs | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs index 5030c1d..fef582e 100644 --- a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs +++ b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs | |||
@@ -77,30 +77,32 @@ namespace OpenSim.Data.MySQL | |||
77 | { | 77 | { |
78 | cmd.Parameters.AddWithValue("?principalID", principalID.ToString()); | 78 | cmd.Parameters.AddWithValue("?principalID", principalID.ToString()); |
79 | 79 | ||
80 | IDataReader result = cmd.ExecuteReader(); | 80 | using(IDataReader result = cmd.ExecuteReader()) |
81 | |||
82 | if (result.Read()) | ||
83 | { | 81 | { |
84 | ret.PrincipalID = principalID; | 82 | if(result.Read()) |
83 | { | ||
84 | ret.PrincipalID = principalID; | ||
85 | 85 | ||
86 | CheckColumnNames(result); | 86 | CheckColumnNames(result); |
87 | 87 | ||
88 | foreach (string s in m_ColumnNames) | 88 | foreach(string s in m_ColumnNames) |
89 | { | 89 | { |
90 | if (s == "UUID") | 90 | if(s == "UUID") |
91 | continue; | 91 | continue; |
92 | 92 | ||
93 | ret.Data[s] = result[s].ToString(); | 93 | ret.Data[s] = result[s].ToString(); |
94 | } | 94 | } |
95 | 95 | ||
96 | return ret; | 96 | dbcon.Close(); |
97 | } | 97 | return ret; |
98 | else | 98 | } |
99 | { | 99 | else |
100 | return null; | 100 | { |
101 | dbcon.Close(); | ||
102 | return null; | ||
103 | } | ||
101 | } | 104 | } |
102 | } | 105 | } |
103 | dbcon.Close(); | ||
104 | } | 106 | } |
105 | } | 107 | } |
106 | 108 | ||