Crash and leak fixes

This commit is contained in:
Henrik Rydgard 2016-03-30 22:17:40 +02:00
parent 9f918fd11b
commit 2b996db298
2 changed files with 4 additions and 1 deletions

View File

@ -85,6 +85,8 @@ FramebufferManagerVulkan::FramebufferManagerVulkan(VulkanContext *vulkan) :
vulkan_(vulkan),
drawPixelsTex_(nullptr),
drawPixelsTexFormat_(GE_FORMAT_INVALID),
convBuf_(nullptr),
convBufSize_(0),
textureCache_(nullptr),
shaderManager_(nullptr),
resized_(false),
@ -267,13 +269,13 @@ void FramebufferManagerVulkan::MakePixelTexture(const u8 *srcPixels, GEBufferFor
// Could share code with the texture cache perhaps.
const uint8_t *data = srcPixels;
if (srcPixelFormat != GE_FORMAT_8888 || srcStride != width) {
data = convBuf_;
u32 neededSize = width * height * 4;
if (!convBuf_ || convBufSize_ < neededSize) {
delete[] convBuf_;
convBuf_ = new u8[neededSize];
convBufSize_ = neededSize;
}
data = convBuf_;
for (int y = 0; y < height; y++) {
switch (srcPixelFormat) {
case GE_FORMAT_565:

View File

@ -108,6 +108,7 @@ Vulkan2D::~Vulkan2D() {
vulkan_->Delete().QueueDeleteDescriptorPool(frameData_[i].descPool);
}
vkDestroyDescriptorSetLayout(device, descriptorSetLayout_, nullptr);
vkDestroyPipelineLayout(device, pipelineLayout_, nullptr);
}
void Vulkan2D::BeginFrame() {