public void Free() { if (_texture != null) { if (AllocationChanged != null) { AllocationChanged(-AllocationSize); } _texture.Dispose(); _texture = null; _charSet.Clear(); _currentX = 0; _rowHeight = 0; _currentY = 0; } }
public void Free() { Texture texture; lock (_syncObj) { texture = _texture; _texture = null; } if (texture != null) { AllocationChanged?.Invoke(-AllocationSize); texture.Dispose(); _charSet.Clear(); _currentX = 0; _rowHeight = 0; _currentY = 0; } }