Fixed memory leak

This commit is contained in:
Ioannis Tsakpinis 2004-10-29 19:48:12 +00:00
parent 96967d1296
commit 9f7b3756e3
4 changed files with 68 additions and 76 deletions

View file

@ -131,6 +131,9 @@ public final class ARBShaderObjects {
* @param strings
*/
public static void glShaderSourceARB(int shaderObj, ByteBuffer[] strings) {
if ( strings == null || strings.length == 0 )
throw new IllegalArgumentException("Invalid shader string array.");
initShaderSource(strings.length);
for ( int i = 0; i < strings.length; i++ ) {
BufferChecks.checkDirect(strings[i]);

View file

@ -112,6 +112,7 @@ public final class GL20 {
*/
public static void glShaderSource(int shader, ByteBuffer string) {
BufferChecks.checkDirect(string);
initShaderSource(1);
setShaderString(0, string, string.position(), string.remaining());
@ -127,6 +128,9 @@ public final class GL20 {
* @param strings
*/
public static void glShaderSource(int shader, ByteBuffer[] strings) {
if ( strings == null || strings.length == 0 )
throw new IllegalArgumentException("Invalid shader string array.");
initShaderSource(strings.length);
for ( int i = 0; i < strings.length; i++ ) {
BufferChecks.checkDirect(strings[i]);