зеркало из https://github.com/mono/ikvm-fork.git
*** empty log message ***
This commit is contained in:
Родитель
9e95d952d8
Коммит
b5aa80c27c
|
@ -41,6 +41,7 @@ package gnu.java.nio.channels;
|
||||||
import gnu.classpath.Configuration;
|
import gnu.classpath.Configuration;
|
||||||
import gnu.java.nio.FileLockImpl;
|
import gnu.java.nio.FileLockImpl;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
@ -85,9 +86,9 @@ public final class FileChannelImpl extends FileChannel
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Open a file. MODE is a combination of the above mode flags. */
|
/* Open a file. MODE is a combination of the above mode flags. */
|
||||||
public FileChannelImpl (String path, int mode) throws FileNotFoundException
|
public FileChannelImpl (File path, int mode) throws FileNotFoundException
|
||||||
{
|
{
|
||||||
stream = open (path, mode);
|
stream = open (path.getPath(), mode);
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,7 @@ import java.lang.reflect.Constructor;
|
||||||
|
|
||||||
final class VMObjectInputStream
|
final class VMObjectInputStream
|
||||||
{
|
{
|
||||||
// TODO move this to ObjectInputStream
|
static ClassLoader currentClassLoader()
|
||||||
static ClassLoader currentClassLoader(SecurityManager sm)
|
|
||||||
{
|
{
|
||||||
Class[] stack = VMStackWalker.getClassContext();
|
Class[] stack = VMStackWalker.getClassContext();
|
||||||
for (int i = 0; i < stack.length; i++)
|
for (int i = 0; i < stack.length; i++)
|
||||||
|
|
|
@ -1055,7 +1055,7 @@ namespace IKVM.Runtime
|
||||||
// NOTE when we're not the default AppDomain and we're being unloaded,
|
// NOTE when we're not the default AppDomain and we're being unloaded,
|
||||||
// we're leaking the JNIEnv (but since JNI outside of the default AppDomain isn't currently supported,
|
// we're leaking the JNIEnv (but since JNI outside of the default AppDomain isn't currently supported,
|
||||||
// I can live with that).
|
// I can live with that).
|
||||||
if(!(AppDomain.CurrentDomain.IsFinalizingForUnload() || Environment.HasShutdownStarted))
|
if(!Environment.HasShutdownStarted)
|
||||||
{
|
{
|
||||||
if(pJNIEnv->localRefs.IsAllocated)
|
if(pJNIEnv->localRefs.IsAllocated)
|
||||||
{
|
{
|
||||||
|
@ -1073,7 +1073,12 @@ namespace IKVM.Runtime
|
||||||
internal static JNIEnv* CreateJNIEnv()
|
internal static JNIEnv* CreateJNIEnv()
|
||||||
{
|
{
|
||||||
JNIEnv* pJNIEnv = TlsHack.pJNIEnv = (JNIEnv*)JniMem.Alloc(sizeof(JNIEnv));
|
JNIEnv* pJNIEnv = TlsHack.pJNIEnv = (JNIEnv*)JniMem.Alloc(sizeof(JNIEnv));
|
||||||
System.Threading.Thread.SetData(cleanupHelperDataSlot, new JNIEnvCleanupHelper(pJNIEnv));
|
// don't touch the LocalDataStore slot when we're being unloaded
|
||||||
|
// (it may have been finalized already)
|
||||||
|
if(!Environment.HasShutdownStarted)
|
||||||
|
{
|
||||||
|
System.Threading.Thread.SetData(cleanupHelperDataSlot, new JNIEnvCleanupHelper(pJNIEnv));
|
||||||
|
}
|
||||||
pJNIEnv->vtable = VtableBuilder.vtable;
|
pJNIEnv->vtable = VtableBuilder.vtable;
|
||||||
object[][] localRefs = new object[32][];
|
object[][] localRefs = new object[32][];
|
||||||
localRefs[0] = new object[JNIEnv.LOCAL_REF_BUCKET_SIZE];
|
localRefs[0] = new object[JNIEnv.LOCAL_REF_BUCKET_SIZE];
|
||||||
|
@ -1092,7 +1097,7 @@ namespace IKVM.Runtime
|
||||||
{
|
{
|
||||||
// don't touch the LocalDataStore slot when we're being unloaded
|
// don't touch the LocalDataStore slot when we're being unloaded
|
||||||
// (it may have been finalized already)
|
// (it may have been finalized already)
|
||||||
if(!(AppDomain.CurrentDomain.IsFinalizingForUnload() || Environment.HasShutdownStarted))
|
if(!Environment.HasShutdownStarted)
|
||||||
{
|
{
|
||||||
// the cleanup helper will eventually free the JNIEnv
|
// the cleanup helper will eventually free the JNIEnv
|
||||||
System.Threading.Thread.SetData(cleanupHelperDataSlot, null);
|
System.Threading.Thread.SetData(cleanupHelperDataSlot, null);
|
||||||
|
|
|
@ -61,8 +61,7 @@ class MemberWrapper
|
||||||
// NOTE when we're being unloaded, we shouldn't clean up the handle, because JNI
|
// NOTE when we're being unloaded, we shouldn't clean up the handle, because JNI
|
||||||
// code running in a finalize can use this handle later on (since finalization is
|
// code running in a finalize can use this handle later on (since finalization is
|
||||||
// unordered). Note that this isn't a leak since the AppDomain is going away anyway.
|
// unordered). Note that this isn't a leak since the AppDomain is going away anyway.
|
||||||
if(!(AppDomain.CurrentDomain.IsFinalizingForUnload() || Environment.HasShutdownStarted)
|
if(!Environment.HasShutdownStarted && handle.IsAllocated)
|
||||||
&& handle.IsAllocated)
|
|
||||||
{
|
{
|
||||||
handle.Free();
|
handle.Free();
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче