X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fprogramdata.cpp;h=8a10f59c0c73beb5d5406816b0d63987fb087558;hb=deecc415cc7ecf24250f2c8c5d6e727fba3eb348;hp=615da767fedefca62eebd06b68fce816aa166ad2;hpb=9885c5465db78b6a1d9cc8bf7ffa7a79fb116afc;p=libs%2Fgl.git diff --git a/source/programdata.cpp b/source/programdata.cpp index 615da767..8a10f59c 100644 --- a/source/programdata.cpp +++ b/source/programdata.cpp @@ -1,3 +1,4 @@ +#include #include "buffer.h" #include "color.h" #include "error.h" @@ -64,7 +65,10 @@ ProgramData::~ProgramData() void ProgramData::uniform(const string &name, Uniform *uni) { if(name[name.size()-1]==']') + { + delete uni; throw invalid_argument("ProgramData::uniform"); + } SlotMap::iterator i = uniform_slots.find(name); if(i!=uniform_slots.end()) @@ -375,7 +379,7 @@ void ProgramData::apply() const /* If any blocks stored in the buffer were updated, bind the buffer here to avoid state thrashing. */ - if(buffered_blocks_updated) + if(buffered_blocks_updated && !ARB_direct_state_access) buffer->bind(); }