Fixed mmap bug, and GUI memory leak.
This was SVN commit r2560.
This commit is contained in:
parent
f4844681a1
commit
c3d42c1025
@ -252,9 +252,11 @@ JSBool JSI_IGUIObject::getProperty(JSContext* cx, JSObject* obj, jsval id, jsval
|
||||
{
|
||||
JSString* s = StringConvert::wchars_to_jsstring(cx, value.m_Items[i].GetRawString().c_str());
|
||||
vector[i] = STRING_TO_JSVAL(s);
|
||||
// TODO: Make sure these strings never get garbage-collected
|
||||
}
|
||||
|
||||
JSObject *obj = JS_NewArrayObject(cx, (jsint)value.m_Items.size(), vector);
|
||||
delete[] vector;
|
||||
|
||||
*vp = OBJECT_TO_JSVAL(obj);
|
||||
break;
|
||||
|
@ -627,11 +627,12 @@ void* mmap(void* user_start, size_t len, int prot, int flags, int fd, off_t offs
|
||||
const DWORD len_hi = (DWORD)((u64)len >> 32);
|
||||
// careful! language doesn't allow shifting 32-bit types by 32 bits.
|
||||
const DWORD len_lo = (DWORD)len & 0xffffffff;
|
||||
const HANDLE hMap = CreateFileMapping(hFile, &sec, flProtect, len_hi, len_lo, (LPCSTR)0);
|
||||
const HANDLE hMap = CreateFileMapping(hFile, psec, flProtect, len_hi, len_lo, (LPCSTR)0);
|
||||
if(hMap == INVALID_HANDLE_VALUE)
|
||||
// bail now so that MapView.. doesn't overwrite the last error value.
|
||||
goto fail;
|
||||
void* addr = MapViewOfFileEx(hMap, dwAccess, len_hi, offset, len_lo, start);
|
||||
// TODO: MapViewOfFileEx wants offset_hi rather than len_hi
|
||||
|
||||
// free the mapping object now, so that we don't have to hold on to its
|
||||
// handle until munmap(). it's not actually released yet due to the
|
||||
|
@ -170,7 +170,7 @@ PSRETURN PSERROR_System_VmodeFailed::getCode() const { return 0x08000003; }
|
||||
PSRETURN PSERROR_Xeromyces_XMLOpenFailed::getCode() const { return 0x09000001; }
|
||||
PSRETURN PSERROR_Xeromyces_XMLParseError::getCode() const { return 0x09000002; }
|
||||
|
||||
const char* PSERROR::what() const
|
||||
const char* PSERROR::what() const throw ()
|
||||
{
|
||||
return GetErrorString(getCode());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user