Implement the rest of #14; close #14

This commit is contained in:
Alcaro
2018-09-17 12:14:34 +02:00
parent 242a0bc9ac
commit 49851a2972
3 changed files with 11 additions and 8 deletions

View File

@@ -6,10 +6,12 @@
#include "flips.h"
#include "crc32.h"
//get rid of dependencies on libstdc++, they eat 200KB on Windows
#ifdef __MINGW32__
//get rid of dependencies on libstdc++, they waste 200KB on this platform
void* operator new(size_t n) { return malloc(n); } // forget allocation failures, let them segfault.
void operator delete(void * p) { free(p); }
extern "C" void __cxa_pure_virtual() { while(1); }
extern "C" void __cxa_pure_virtual() { abort(); }
#endif
//TODO: delete
@@ -449,7 +451,8 @@ config::~config()
{
LPWSTR data = this->flatten();
//puts(data);
filewrite::write(this->filename, (struct mem){ (uint8_t*)data, wcslen(data)*sizeof(WCHAR) });
struct mem m = { (uint8_t*)data, wcslen(data)*sizeof(WCHAR) };
filewrite::write(this->filename, m);
free(data);
free(this->filename);
}