mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-07-04 15:54:20 +00:00
first patch of UB
This commit is contained in:
@@ -60,11 +60,19 @@ void StitchedTexture::freeFrameTextures()
|
||||
|
||||
StitchedTexture::~StitchedTexture()
|
||||
{
|
||||
for(AUTO_VAR(it, frames->begin()); it != frames->end(); ++it)
|
||||
{
|
||||
delete *it;
|
||||
// 4jcraft added null check, in PreStitchedTextures::stitch(), than ::loadUVs()
|
||||
// all new SimpleIcons deriving from StitchedIcons are calling the
|
||||
// constructor which does frames = NULL
|
||||
// so the program breaks on delete oldClock in ::loadUVs()
|
||||
// but scince "frames" is never allocated (StitchedTexture::init())
|
||||
// not called, frames was never called (only the constructor)
|
||||
if(frames) {
|
||||
for(AUTO_VAR(it, frames->begin()); it != frames->end(); ++it)
|
||||
{
|
||||
delete *it;
|
||||
}
|
||||
delete frames;
|
||||
}
|
||||
delete frames;
|
||||
}
|
||||
|
||||
void StitchedTexture::initUVs(float U0, float V0, float U1, float V1)
|
||||
@@ -351,4 +359,4 @@ int StitchedTexture::getFlags() const
|
||||
bool StitchedTexture::hasOwnData()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user