#341: MapMagic 2 / General Bugz
Status: Completed

[QUOTE="taylank, post: 5882648, member: 147358"][USER=206738]@Wright[/USER] I don't know if this is related to the memory issues I emailed you about, but I noticed in your code some implementations of IApplyData do not check if the tex field already references a Texture2D object before assigning a new texture instance to it.

In case of a refresh due to a resolution change, if tex is not null, the Texture2D object it's pointing to will not get destroyed

[code] // in case of a refresh due to a resolution change, if tex is not null, the Texture2D object it's pointing to will not get destroyed if (tex==null || tex.width!=resolution || tex.height!=resolution || tex.format!=textureFormat) { tex = new Texture2D(resolution, resolution, textureFormat, false, true); tex.wrapMode = TextureWrapMode.Mirror; //to avoid border seams //tex.hideFlags = HideFlags.DontSave; //tex.filterMode = FilterMode.Point;

matPropSerializer.SetTexture(textureNames[i], tex); }[/code]

Created by akaWraith May 23, 2020