aboutsummaryrefslogtreecommitdiff
path: root/libjava/jawt.c
diff options
context:
space:
mode:
authorAnthony Green <green@redhat.com>2005-05-18 14:20:53 +0000
committerAnthony Green <green@gcc.gnu.org>2005-05-18 14:20:53 +0000
commit9a6411ed3017504e23874b29150e06f9126788a5 (patch)
treee1bb7b54d3a4998a94109fc23d7049a9867f87fb /libjava/jawt.c
parent4e876a0fb9db7f2bfc6ba477c468b4cb8ec2f6a9 (diff)
downloadgcc-9a6411ed3017504e23874b29150e06f9126788a5.zip
gcc-9a6411ed3017504e23874b29150e06f9126788a5.tar.gz
gcc-9a6411ed3017504e23874b29150e06f9126788a5.tar.bz2
gtk_jawt.c (classpath_jawt_object_lock, [...]): New functions.
2005-05-18 Anthony Green <green@redhat.com> * jni/gtk-peer/gtk_jawt.c (classpath_jawt_object_lock, classpath_jawt_object_unlock, classpath_jawt_create_lock, classpath_jawt_destroy_lock): New functions. * jni/classpath/classpath_jawt.h (classpath_jawt_object_lock, classpath_jawt_object_unlock, classpath_jawt_create_lock, classpath_jawt_destroy_lock): New functions. * include/jawt.h (struct _JAWT_DrawingSurface): Add lock field. * jawt.c: #include malloc.h. (_Jv_Lock): Use lock. (_Jv_Unlock): Ditto. (_Jv_GetDrawingSurface): Initialize lock. (_Jv_FreeDrawingSurface): Destroy lock. (_Jv_FreeDrawingSurfaceInfo): Free platformInfo. From-SVN: r99903
Diffstat (limited to 'libjava/jawt.c')
-rw-r--r--libjava/jawt.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libjava/jawt.c b/libjava/jawt.c
index 20890da..bb03c63 100644
--- a/libjava/jawt.c
+++ b/libjava/jawt.c
@@ -40,6 +40,7 @@
#include <jawt.h>
#include <jawt_md.h>
#include "classpath_jawt.h"
+#include <malloc.h>
static jint (JNICALL _Jv_Lock) (JAWT_DrawingSurface* surface);
static void (JNICALL _Jv_Unlock) (JAWT_DrawingSurface* surface);
@@ -76,14 +77,13 @@ JAWT_GetAWT (JNIEnv* env, JAWT* awt)
static jint
(JNICALL _Jv_Lock) (JAWT_DrawingSurface* surface)
{
- /* lock the drawing surface */
- return classpath_jawt_lock ();
+ return classpath_jawt_object_lock (surface->lock);
}
static void
(JNICALL _Jv_Unlock) (JAWT_DrawingSurface* surface)
{
- classpath_jawt_unlock ();
+ classpath_jawt_object_unlock (surface->lock);
}
static JAWT_DrawingSurfaceInfo*
@@ -109,6 +109,7 @@ static void
surface_info_x11->drawable = 0;
surface_info_x11->visualID = 0;
+ free (surface_info->platformInfo);
free (surface_info);
surface_info = NULL;
}
@@ -135,6 +136,8 @@ static JAWT_DrawingSurface*
surface->surface_info = (JAWT_DrawingSurfaceInfo*) malloc (sizeof (JAWT_DrawingSurfaceInfo));
+ surface->lock = classpath_jawt_create_lock ();
+
if (surface->surface_info == NULL)
return NULL;
@@ -158,6 +161,7 @@ static JAWT_DrawingSurface*
static void
(JNICALL _Jv_FreeDrawingSurface) (JAWT_DrawingSurface* surface)
{
+ classpath_jawt_destroy_lock (surface->lock);
free (surface);
}