This commit is contained in:
jfrijters 2005-05-02 08:12:36 +00:00
Родитель 9e95d952d8
Коммит b5aa80c27c
4 изменённых файлов: 13 добавлений и 9 удалений

Просмотреть файл

@ -41,6 +41,7 @@ package gnu.java.nio.channels;
import gnu.classpath.Configuration;
import gnu.java.nio.FileLockImpl;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
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. */
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;
}

Просмотреть файл

@ -28,8 +28,7 @@ import java.lang.reflect.Constructor;
final class VMObjectInputStream
{
// TODO move this to ObjectInputStream
static ClassLoader currentClassLoader(SecurityManager sm)
static ClassLoader currentClassLoader()
{
Class[] stack = VMStackWalker.getClassContext();
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,
// we're leaking the JNIEnv (but since JNI outside of the default AppDomain isn't currently supported,
// I can live with that).
if(!(AppDomain.CurrentDomain.IsFinalizingForUnload() || Environment.HasShutdownStarted))
if(!Environment.HasShutdownStarted)
{
if(pJNIEnv->localRefs.IsAllocated)
{
@ -1073,7 +1073,12 @@ namespace IKVM.Runtime
internal static JNIEnv* CreateJNIEnv()
{
JNIEnv* pJNIEnv = TlsHack.pJNIEnv = (JNIEnv*)JniMem.Alloc(sizeof(JNIEnv));
// 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;
object[][] localRefs = new object[32][];
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
// (it may have been finalized already)
if(!(AppDomain.CurrentDomain.IsFinalizingForUnload() || Environment.HasShutdownStarted))
if(!Environment.HasShutdownStarted)
{
// the cleanup helper will eventually free the JNIEnv
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
// 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.
if(!(AppDomain.CurrentDomain.IsFinalizingForUnload() || Environment.HasShutdownStarted)
&& handle.IsAllocated)
if(!Environment.HasShutdownStarted && handle.IsAllocated)
{
handle.Free();
}