Problem with custom ofTextureData and onSurfaceChanged()

Hi all,

i’m trying to create an ofFbo with a custom texture configured with ofTextureData.

i’m getting a strange behaviour, if i create this new texture the crashes on the onSurfaceChanged() method, on

    	OFAndroid.resize(w, h);

to be exact.

the code that i’m using to create my new texture is:

	    ofLog() << "HERE SETUP 1";
ofTextureData td;
td.width = vj.outFbo.getWidth();
td.height = vj.outFbo.getHeight();
td.tex_w = td.width;
td.tex_h = td.height;
td.tex_t = 1; // Hack!
td.tex_u = 1;
td.textureTarget = GL_TEXTURE_2D;
td.glTypeInternal = GL_RGBA;
td.bFlipTexture = false;
td.useTextureMatrix = true;

// hack to initialize gl resources from outside ofTexture
texture.texData = td;
texture.texData.bAllocated = true;

ofLog() << "HERE SETUP 2 " << texture.texData.textureID;
glGenTextures(1, (GLuint *)&texture.texData.textureID);
ofLog() << "HERE SETUP 2 " << texture.texData.textureID;

glEnable(texture.texData.textureTarget);

glBindTexture(texture.texData.textureTarget, (GLuint)texture.texData.textureID);

glDisable(texture.texData.textureTarget);

	    ofLog() << "HERE SETUP 3";
vj.outFbo.attachTexture(texture, GL_RGBA, 0);

how can it be that this new textures makes the app crash on the resize() method??
i’m following the methods connectes to the resize event but really can’t understand what is happening…

someboy can give me some information about this??