You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix issue #3:
class Texture has a shared_ptr to weak_ptr. The weak_ptr observes a
shared_ptr in a list in class Window.
When Window::setRenderer is called, Textures will be released and the
previous renderer is also release. Then a new renderer is created. User
should reload textures by themselves.
测试代码如下
根据当前情况,nrnd的建立会导致rnd的失效,此时rnd渲染的t和b都处于无效状态(Invalid Texture).
解决这个问题可以将Texture中的指针改为weak_ptr,并将真正的Texture放入Window类中. 但是这样的话又不能在Texture超出作用域的时候自动释放(因为都保存在Window里了),这样很有可能引起内存暴涨...
The text was updated successfully, but these errors were encountered: