mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-04-05 06:25:46 +00:00
Fixed memory leak
This commit is contained in:
parent
96967d1296
commit
9f7b3756e3
4 changed files with 68 additions and 76 deletions
|
|
@ -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]);
|
||||
|
|
|
|||
|
|
@ -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]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue