@@ -653,6 +653,7 @@ cc.DrawingPrimitiveWebGL = cc.DrawingPrimitive.extend({
653653 glContext . vertexAttribPointer ( cc . VERTEX_ATTRIB_POSITION , 2 , glContext . FLOAT , false , 0 , 0 ) ;
654654
655655 glContext . drawArrays ( glContext . POINTS , 0 , 1 ) ;
656+ glContext . deleteBuffer ( pointBuffer ) ;
656657
657658 cc . INCREMENT_GL_DRAWS ( 1 ) ;
658659 } ,
@@ -681,6 +682,7 @@ cc.DrawingPrimitiveWebGL = cc.DrawingPrimitive.extend({
681682 glContext . vertexAttribPointer ( cc . VERTEX_ATTRIB_POSITION , 2 , glContext . FLOAT , false , 0 , 0 ) ;
682683
683684 glContext . drawArrays ( glContext . POINTS , 0 , points . length ) ;
685+ glContext . deleteBuffer ( pointBuffer ) ;
684686
685687 cc . INCREMENT_GL_DRAWS ( 1 ) ;
686688 } ,
@@ -714,6 +716,8 @@ cc.DrawingPrimitiveWebGL = cc.DrawingPrimitive.extend({
714716 glContext . vertexAttribPointer ( cc . VERTEX_ATTRIB_POSITION , 2 , glContext . FLOAT , false , 0 , 0 ) ;
715717
716718 glContext . drawArrays ( glContext . LINES , 0 , 2 ) ;
719+ glContext . deleteBuffer ( pointBuffer ) ;
720+
717721 cc . INCREMENT_GL_DRAWS ( 1 ) ;
718722 } ,
719723
@@ -770,6 +774,7 @@ cc.DrawingPrimitiveWebGL = cc.DrawingPrimitive.extend({
770774 glContext . drawArrays ( glContext . LINE_LOOP , 0 , vertices . length ) ;
771775 else
772776 glContext . drawArrays ( glContext . LINE_STRIP , 0 , vertices . length ) ;
777+ glContext . deleteBuffer ( pointBuffer ) ;
773778
774779 cc . INCREMENT_GL_DRAWS ( 1 ) ;
775780 } ,
@@ -796,6 +801,7 @@ cc.DrawingPrimitiveWebGL = cc.DrawingPrimitive.extend({
796801 glContext . bufferData ( glContext . ARRAY_BUFFER , this . _pointsToTypeArray ( poli ) , glContext . STATIC_DRAW ) ;
797802 glContext . vertexAttribPointer ( cc . VERTEX_ATTRIB_POSITION , 2 , glContext . FLOAT , false , 0 , 0 ) ;
798803 glContext . drawArrays ( glContext . TRIANGLE_FAN , 0 , poli . length ) ;
804+ glContext . deleteBuffer ( pointBuffer ) ;
799805
800806 cc . INCREMENT_GL_DRAWS ( 1 ) ;
801807 } ,
@@ -844,6 +850,7 @@ cc.DrawingPrimitiveWebGL = cc.DrawingPrimitive.extend({
844850 glContext . vertexAttribPointer ( cc . VERTEX_ATTRIB_POSITION , 2 , glContext . FLOAT , false , 0 , 0 ) ;
845851
846852 glContext . drawArrays ( glContext . LINE_STRIP , 0 , segments + additionalSegment ) ;
853+ glContext . deleteBuffer ( pointBuffer ) ;
847854
848855 cc . INCREMENT_GL_DRAWS ( 1 ) ;
849856 } ,
@@ -881,6 +888,7 @@ cc.DrawingPrimitiveWebGL = cc.DrawingPrimitive.extend({
881888 glContext . vertexAttribPointer ( cc . VERTEX_ATTRIB_POSITION , 2 , glContext . FLOAT , false , 0 , 0 ) ;
882889
883890 glContext . drawArrays ( glContext . LINE_STRIP , 0 , segments + 1 ) ;
891+ glContext . deleteBuffer ( pointBuffer ) ;
884892
885893 cc . INCREMENT_GL_DRAWS ( 1 ) ;
886894 } ,
@@ -918,6 +926,7 @@ cc.DrawingPrimitiveWebGL = cc.DrawingPrimitive.extend({
918926 glContext . bufferData ( glContext . ARRAY_BUFFER , vertices , glContext . STATIC_DRAW ) ;
919927 glContext . vertexAttribPointer ( cc . VERTEX_ATTRIB_POSITION , 2 , glContext . FLOAT , false , 0 , 0 ) ;
920928 glContext . drawArrays ( glContext . LINE_STRIP , 0 , segments + 1 ) ;
929+ glContext . deleteBuffer ( pointBuffer ) ;
921930
922931 cc . INCREMENT_GL_DRAWS ( 1 ) ;
923932 } ,
@@ -977,6 +986,7 @@ cc.DrawingPrimitiveWebGL = cc.DrawingPrimitive.extend({
977986 glContext . bufferData ( glContext . ARRAY_BUFFER , vertices , glContext . STATIC_DRAW ) ;
978987 glContext . vertexAttribPointer ( cc . VERTEX_ATTRIB_POSITION , 2 , glContext . FLOAT , false , 0 , 0 ) ;
979988 glContext . drawArrays ( glContext . LINE_STRIP , 0 , segments + 1 ) ;
989+ glContext . deleteBuffer ( pointBuffer ) ;
980990
981991 cc . INCREMENT_GL_DRAWS ( 1 ) ;
982992 } ,
0 commit comments