I just learned that pchar is not ref counted like I used to think so I’m 
curious why this code doesn’t fail. Shouldn’t this crash because I free 
TStringList and then access GetText?

strings := TStringList.Create;
strings.LoadFromFile(vertexShaderPath);
vertexShaderSource := strings.GetText;
strings.Free;
glShaderSource(vertexShaderID, 1, @vertexShaderSource, nil);

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to