Skip to content
This repository
Browse code

Merge pull request #2208 from asmaloney/mem_problems

Fix memory leaks & use correct "delete" for arrays
  • Loading branch information...
commit f631f0fcc4393f719ec8b7f80fd00166538cf6cf 2 parents 5cee1fe + c1cc1b3
Memphiz authored February 12, 2013
6  xbmc/network/AirTunesServer.cpp
@@ -339,8 +339,12 @@ ao_device* CAirTunesServer::AudioOutputFunctions::ao_open_live(int driver_id, ao
339 339
   header.durationMs = 0;
340 340
 
341 341
   if (device->pipe->Write(&header, sizeof(header)) == 0)
  342
+  {
  343
+    delete device->pipe;
  344
+    delete device;
342 345
     return 0;
343  
-
  346
+  }
  347
+  
344 348
   ThreadMessage tMsg = { TMSG_MEDIA_STOP };
345 349
   CApplicationMessenger::Get().SendMessage(tMsg, true);
346 350
 
2  xbmc/visualizations/Vortex/VortexVis/Core/Renderer.cpp
@@ -1347,7 +1347,7 @@ void Renderer::Sphere(int del_uhol_x, int del_uhol_y, float size)
1347 1347
 		//		g_device->DrawPrimitive(D3DPT_TRIANGLESTRIP, i*2*(del_y+1), 2*del_y );
1348 1348
 		m_pD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2*del_uhol_y, &v[i*2*(del_uhol_y+1)], sizeof(PosColNormalUVVertex));
1349 1349
 
1350  
-	delete v;
  1350
+	delete [] v;
1351 1351
 	//  pd->DrawPrimitive( D3DPT_TRIANGLESTRIP, i*2*(del_y+1), 2*del_y );
1352 1352
 }
1353 1353
 
2  xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp
@@ -634,7 +634,7 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v
634 634
     }
635 635
   }
636 636
   if (supported_modes)
637  
-    delete supported_modes;
  637
+    delete [] supported_modes;
638 638
 }
639 639
 
640 640
 void CEGLNativeTypeRaspberryPI::TvServiceCallback(uint32_t reason, uint32_t param1, uint32_t param2)

0 notes on commit f631f0f

Please sign in to comment.
Something went wrong with that request. Please try again.