aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-04-20 03:32:38 +0100
committerJustin Clark-Casey (justincc)2012-04-20 03:32:38 +0100
commit4ac2f839bdba84569877f5ab8c2e9ea0cfe87413 (patch)
treea93d2fa49ea8feeaba4212ee0400d70c51fbdbb1 /OpenSim
parentconcerns GenericSystemDrawing.cs (diff)
downloadopensim-SC_OLD-4ac2f839bdba84569877f5ab8c2e9ea0cfe87413.zip
opensim-SC_OLD-4ac2f839bdba84569877f5ab8c2e9ea0cfe87413.tar.gz
opensim-SC_OLD-4ac2f839bdba84569877f5ab8c2e9ea0cfe87413.tar.bz2
opensim-SC_OLD-4ac2f839bdba84569877f5ab8c2e9ea0cfe87413.tar.xz
Remember to dispose of the bitmap opened from a file in GatekeeperServiceConnector.GetMapImage()
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs15
1 files changed, 11 insertions, 4 deletions
diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
index 0430ef6..19dffc3 100644
--- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
@@ -154,7 +154,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
154 154
155 UUID mapTile = m_HGMapImage; 155 UUID mapTile = m_HGMapImage;
156 string filename = string.Empty; 156 string filename = string.Empty;
157 Bitmap bitmap = null; 157
158 try 158 try
159 { 159 {
160 WebClient c = new WebClient(); 160 WebClient c = new WebClient();
@@ -167,11 +167,18 @@ namespace OpenSim.Services.Connectors.Hypergrid
167 c.DownloadFile(imageURL, filename); 167 c.DownloadFile(imageURL, filename);
168 } 168 }
169 else 169 else
170 {
170 m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: using cached image"); 171 m_log.DebugFormat("[GATEKEEPER SERVICE CONNECTOR]: using cached image");
172 }
173
174 byte[] imageData = null;
171 175
172 bitmap = new Bitmap(filename); 176 using (Bitmap bitmap = new Bitmap(filename))
173 //m_log.Debug("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width); 177 {
174 byte[] imageData = OpenJPEG.EncodeFromImage(bitmap, true); 178 //m_log.Debug("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width);
179 imageData = OpenJPEG.EncodeFromImage(bitmap, true);
180 }
181
175 AssetBase ass = new AssetBase(UUID.Random(), "region " + name, (sbyte)AssetType.Texture, regionID.ToString()); 182 AssetBase ass = new AssetBase(UUID.Random(), "region " + name, (sbyte)AssetType.Texture, regionID.ToString());
176 183
177 // !!! for now 184 // !!! for now