Problem with JAWT - User Breakpoint in JNI. Perhaps a Win2000 problem?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Amit_Rosner
Posted On:   Thursday, November 22, 2001 01:04 AM

Hi! I'm using the following "JAWT_Info.h" file in JNI to get the HWND of a Canvas object from Java and draw to it. The problem is that when the execution gets to the destructor of the JAWT_Info class, there is a user breakpoint in the line: awt.FreeDrawingSurface(ds); It says: "User breakpoint called from code at 0x77f9f9df". Stack: NTDLL! 77f9f9df() NTDLL! 77fb4966() NTDLL! 77fb3bdc() NTDLL! 77fa7131() NTDLL! 77fca4cb() MSVCRT! 7800113d() MSVCRT! 78001f5f() JAWT_Info::~JAWT_Info() line 94 + 15 bytes I'm running on Win2000 pl   More>>

Hi!



I'm using the following "JAWT_Info.h" file in JNI to get the HWND of a Canvas object from Java and draw to it. The problem is that when the execution gets to the destructor of the JAWT_Info class, there is a user breakpoint in the line:



awt.FreeDrawingSurface(ds);



It says: "User breakpoint called from code at 0x77f9f9df".



Stack:


NTDLL! 77f9f9df()

NTDLL! 77fb4966()

NTDLL! 77fb3bdc()

NTDLL! 77fa7131()

NTDLL! 77fca4cb()

MSVCRT! 7800113d()

MSVCRT! 78001f5f()

JAWT_Info::~JAWT_Info() line 94 + 15 bytes



I'm running on Win2000 platform.



The file:



#ifndef __JAWT_INFO_H__

#define __JAWT_INFO_H__



#include



#include "jawt_md.h"



#include





class JAWT_Info

{

private:



JAWT awt;

JAWT_DrawingSurface* ds;

JAWT_DrawingSurfaceInfo* dsi;

JAWT_Win32DrawingSurfaceInfo* dsi_win;



public:



JAWT_Info(JNIEnv *env, jobject canvas)

{

jboolean result;

jint lock;



// Get the AWT

awt.version = JAWT_VERSION_1_3;

result = JAWT_GetAWT(env, &awt);

assert(result != JNI_FALSE);

// Get the drawing surface

ds = awt.GetDrawingSurface(env, canvas);

if(ds == NULL)

return;

// Lock the drawing surface

lock = ds->Lock(ds);

assert((lock & JAWT_LOCK_ERROR) == 0);



// Get the drawing surface info

dsi = ds->GetDrawingSurfaceInfo(ds);



// Get the platform-specific drawing info

dsi_win = (JAWT_Win32DrawingSurfaceInfo*)dsi->platformInfo;

}



HWND getHWND()

{

if(dsi_win == NULL)

return NULL;

return dsi_win->hwnd;

}



HDC getHDC()

{

if(dsi_win == NULL)

return NULL;

return dsi_win->hdc;

}



virtual ~JAWT_Info()

{

if(ds != NULL)

{

// Free the drawing surface info

ds->FreeDrawingSurfaceInfo(dsi);

// Unlock the drawing surface

ds->Unlock(ds);

// Free the drawing surface

awt.FreeDrawingSurface(ds);

}

}

};



#endif //__JAWT_INFO_H__



Please tell me what is wrong and what I should do to prevent that from happening.

   <<Less

Re: Problem with JAWT - User Breakpoint in JNI. Perhaps a Win2000 problem?

Posted By:   gowri_gopalakrishnan  
Posted On:   Thursday, February 7, 2002 08:36 AM

Hi I came across the same problem and if i just comment out the freedrawingsurfaceinfo line then windows2000 seems to proceed. But however if i add a test if(ds != NULL) then it executes the free...command. This means that the pointer is not freed.
I would also appreciate anyone who has any idea about this.

Gowri
About | Sitemap | Contact