From 7fd1c770fd257963634ab3e4701b9ab04ff9e6fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandro=20S=C3=A1nchez=20Bach?= Date: Fri, 13 May 2016 16:53:49 +0200 Subject: [PATCH] Version bump: Nucleus v0.1.0 --- README.md | 2 +- .../filesystem/device/host_path/host_path_device.cpp | 2 +- nucleus/filesystem/device/host_path/host_path_file.cpp | 4 +++- nucleus/nucleus.cpp | 2 +- nucleus/system/keys.cpp | 10 ++++++---- nucleus/ui/screens/screen_logo.cpp | 2 +- wrappers/ios/Info.plist | 2 +- wrappers/windows/drop_target.cpp | 3 +++ 8 files changed, 17 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 6b40095..239a89f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ Nucleus ======= -[![Last Release](https://img.shields.io/badge/version-0.0.4-brightgreen.svg?style=flat)](https://github.com/AlexAltea/nucleus/releases) +[![Last Release](https://img.shields.io/badge/version-0.1.0-brightgreen.svg?style=flat)](https://github.com/AlexAltea/nucleus/releases) Created by Alexandro Sánchez Bach. diff --git a/nucleus/filesystem/device/host_path/host_path_device.cpp b/nucleus/filesystem/device/host_path/host_path_device.cpp index f251f7f..997b0b5 100644 --- a/nucleus/filesystem/device/host_path/host_path_device.cpp +++ b/nucleus/filesystem/device/host_path/host_path_device.cpp @@ -18,7 +18,7 @@ HostPathDevice::HostPathDevice(const Path& mountPath, const Path& localPath) File* HostPathDevice::openFile(const Path& path, OpenMode mode) { auto* file = new HostPathFile(localPath + path, mode); - if (!file->isOpen()) { + if (!file || !file->isOpen()) { delete file; return nullptr; } diff --git a/nucleus/filesystem/device/host_path/host_path_file.cpp b/nucleus/filesystem/device/host_path/host_path_file.cpp index 44de1f6..5a2063a 100644 --- a/nucleus/filesystem/device/host_path/host_path_file.cpp +++ b/nucleus/filesystem/device/host_path/host_path_file.cpp @@ -56,7 +56,9 @@ HostPathFile::HostPathFile(const Path& path, OpenMode mode) { } HostPathFile::~HostPathFile() { - std::fclose(handle); + if (handle) { + std::fclose(handle); + } } Size HostPathFile::read(void* dst, Size size) { diff --git a/nucleus/nucleus.cpp b/nucleus/nucleus.cpp index 0c58ad6..31d2369 100644 --- a/nucleus/nucleus.cpp +++ b/nucleus/nucleus.cpp @@ -49,7 +49,7 @@ void nucleusPrepare(HWND hwnd, HDC hdc, int width, int height) { int nucleusInitialize(int argc, char **argv) { if (argc <= 1) { std::cout - << "Nucleus v0.0.4: A PlayStation 3 emulator.\n" + << "Nucleus v0.1.0: A PlayStation 3 emulator.\n" << "Usage: nucleus [arguments] path/to/executable.ppu.self\n" << "Arguments:\n" << " --console Avoids the Nucleus UI window, disabling GPU backends.\n" diff --git a/nucleus/system/keys.cpp b/nucleus/system/keys.cpp index 457a856..d6524a0 100644 --- a/nucleus/system/keys.cpp +++ b/nucleus/system/keys.cpp @@ -33,10 +33,12 @@ static struct KeyvaultHandler { KeyvaultHandler() { auto file = fs::AppFileSystem::openFile(fs::APP_LOCATION_ROAMING, KEYVAULT_FILE, fs::Read); - auto size = file->attributes().size; - buffer.resize(size + 1); - file->read(buffer.data(), size); - doc.parse<0>(buffer.data()); + if (file.get()) { + auto size = file->attributes().size; + buffer.resize(size + 1); + file->read(buffer.data(), size); + doc.parse<0>(buffer.data()); + } } } keyvault; diff --git a/nucleus/ui/screens/screen_logo.cpp b/nucleus/ui/screens/screen_logo.cpp index 22cabf1..841b6bc 100644 --- a/nucleus/ui/screens/screen_logo.cpp +++ b/nucleus/ui/screens/screen_logo.cpp @@ -27,7 +27,7 @@ ScreenLogo::ScreenLogo(UI* manager) : Screen(manager) { logo->style.width = 50_pct; version = new WidgetText(&body, "version"); - version->update(lightFont, 30_px, "Version v0.1.0 from 2016-04-01"); + version->update(lightFont, 30_px, "Version v0.1.0 from 2016-05-14"); version->style.margin.top = 0_px; version->style.width = 25_pct; version->style.color = Color{1,1,1,1}; diff --git a/wrappers/ios/Info.plist b/wrappers/ios/Info.plist index c275688..9632b55 100644 --- a/wrappers/ios/Info.plist +++ b/wrappers/ios/Info.plist @@ -11,7 +11,7 @@ CFBundleName Nucleus CFBundleVersion - 0.0.4 + 0.1.0 UIRequiredDeviceCapabilities diff --git a/wrappers/windows/drop_target.cpp b/wrappers/windows/drop_target.cpp index fbb5990..0abe28c 100644 --- a/wrappers/windows/drop_target.cpp +++ b/wrappers/windows/drop_target.cpp @@ -35,5 +35,8 @@ HRESULT DropTarget::DragLeave() { } HRESULT DropTarget::Drop(IDataObject* pDataObj, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect) { + if (pDataObj == nullptr) { + return E_FAIL; + } return E_NOTIMPL; }