Author Topic: NullPointerException in FrameBuffer.dispose().  (Read 1043 times)

Offline kiffa

  • long
  • ***
  • Posts: 199
    • View Profile
NullPointerException in FrameBuffer.dispose().
« on: June 22, 2013, 07:49:27 am »
When exiting my game, sometimes the app will crash. I doubt the problem was caused by multi threads,  but after checking many times, i didn't found the reason, could you give me some guides?

codes:

Code: [Select]
//in onDrawFrame():  -- GLThread
  destroyDirect();
 
  private void destroyDirect() {
    WLog.d("--------------------------------------------");
    WLog.d("gamerender destroy!!!!");

    getGameContext().getSceneManager().destroyCurrentScene();
    getGameContext().getWorld().dispose();

    if (mFrameBuffer != null) {
      WLog.d("--------------------------------------------");
      WLog.d("dispose world!");
      getGameContext().getWorld().dispose();
      WLog.d("--------------------------------------------");
      WLog.d("dispose framebuffer!");
      mFrameBuffer.dispose();
      WLog.d("--------------------------------------------");
    }
}


logs:


06-22 13:23:55.204: D/Woo3d(12923): --------------------------------------------
06-22 13:23:55.204: D/Woo3d(12923): gamerender destroy!!!!
06-22 13:23:55.204: D/Woo3d(12923): destroy current scene
06-22 13:23:55.204: D/Woo3d(12923): clear camera controller
06-22 13:23:55.204: D/Woo3d(12923): free texture: bar_1
06-22 13:23:55.204: D/texture(12923): removeAndUnload texture bar_1
06-22 13:23:55.204: D/Woo3d(12923): free texture: bar_2
06-22 13:23:55.204: D/texture(12923): removeAndUnload texture bar_2
06-22 13:23:55.204: D/Woo3d(12923): free texture: bridge
06-22 13:23:55.204: D/texture(12923): removeAndUnload texture bridge
06-22 13:23:55.204: D/Woo3d(12923): free texture: light
06-22 13:23:55.204: D/texture(12923): removeAndUnload texture light
06-22 13:23:55.204: D/Woo3d(12923): free texture: road
06-22 13:23:55.204: D/texture(12923): removeAndUnload texture road
06-22 13:23:55.204: D/Woo3d(12923): free texture: sea
06-22 13:23:55.204: D/texture(12923): removeAndUnload texture sea
06-22 13:23:55.204: D/Woo3d(12923): free texture: flag
06-22 13:23:55.204: D/texture(12923): removeAndUnload texture flag
06-22 13:23:55.204: D/Woo3d(12923): free texture: start
06-22 13:23:55.204: D/texture(12923): removeAndUnload texture start
06-22 13:23:55.204: D/Woo3d(12923): free texture: accTrigger_1
06-22 13:23:55.204: D/texture(12923): removeAndUnload texture accTrigger_1
06-22 13:23:55.204: D/Woo3d(12923): free texture: accTrigger_2
06-22 13:23:55.204: D/texture(12923): removeAndUnload texture accTrigger_2
06-22 13:23:55.274: D/dalvikvm(12923): GC_EXPLICIT freed 2076K, 66% free 6588K/19335K, external 8736K/10356K, paused 71ms
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object483'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object482'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object481'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object480'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object479'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object478'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object477'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object476'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object475'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object474'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object473'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object472'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object471'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object470'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object469'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object468'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object467'
06-22 13:23:55.284: D/Woo3d(12923): unload object3d: 4_bar_1
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object466'
06-22 13:23:55.284: D/Woo3d(12923): unload object3d: 4_bar_2
06-22 13:23:55.284: D/Woo3d(12923): unload object3d: 4_bridge
06-22 13:23:55.284: D/Woo3d(12923): unload object3d: 4_light
06-22 13:23:55.284: D/Woo3d(12923): unload object3d: 4_road
06-22 13:23:55.284: D/Woo3d(12923): unload object3d: 4_sea
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object465'
06-22 13:23:55.284: D/Woo3d(12923): --------------------------------------------
06-22 13:23:55.284: D/Woo3d(12923): dispose world!
06-22 13:23:55.284: D/Woo3d(12923): --------------------------------------------
06-22 13:23:55.284: D/Woo3d(12923): dispose framebuffer!
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object464'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object463'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object462'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object461'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object460'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object459'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object458'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object457'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object456'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object455'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object454'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object453'
06-22 13:23:55.284: I/jPCT-AE(12923): All texture data unloaded from gpu!
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object452'
06-22 13:23:55.284: I/jPCT-AE(12923): Disposing VBOs!
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object451'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object450'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object449'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object448'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object447'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object446'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object445'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object444'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object443'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object442'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object441'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object440'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object439'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object438'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object437'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object436'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object435'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object434'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object433'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object432'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object431'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object430'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object429'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object428'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object427'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object426'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object425'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object424'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object423'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object422'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object406'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object405'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object404'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object403'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object402'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object401'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object400'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object399'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object398'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object397'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object396'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object395'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object394'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object393'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object392'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object391'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object390'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object389'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object388'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object387'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object386'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object385'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object384'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object383'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object382'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object381'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object380'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object379'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object378'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object377'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object376'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object375'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object374'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object373'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object372'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object371'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object370'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object369'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object368'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object367'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object366'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object365'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object364'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object363'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object362'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object361'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object360'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object359'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object358'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object357'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object356'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object355'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object354'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object353'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object351'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object350'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object349'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object348'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object347'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object346'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object345'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object341'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object325'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object340'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object336'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object342'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object337'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object180'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object339'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object322'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object338'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object251'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object109'
06-22 13:23:55.304: W/dalvikvm(12923): threadid=18: thread exiting with uncaught exception (group=0x4018b560)
06-22 13:23:55.314: E/AndroidRuntime(12923): FATAL EXCEPTION: GLThread 35
06-22 13:23:55.314: E/AndroidRuntime(12923): java.lang.NullPointerException
06-22 13:23:55.314: E/AndroidRuntime(12923):    at com.threed.jpct.GLRenderer.dispose(GLRenderer.java:478)
06-22 13:23:55.314: E/AndroidRuntime(12923):    at com.threed.jpct.FrameBuffer.dispose(FrameBuffer.java:378)
06-22 13:23:55.314: E/AndroidRuntime(12923):    at com.zwenyu.woo3d.components.GameRenderer.destroyDirect(GameRenderer.java:446)
06-22 13:23:55.314: E/AndroidRuntime(12923):    at com.zwenyu.woo3d.components.GameRenderer.onDrawFrame(GameRenderer.java:131)
06-22 13:23:55.314: E/AndroidRuntime(12923):    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1363)
06-22 13:23:55.314: E/AndroidRuntime(12923):    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
« Last Edit: June 22, 2013, 07:54:44 am by kiffa »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: NullPointerException in FrameBuffer.dispose().
« Reply #1 on: June 22, 2013, 08:44:33 am »
I'll look into it.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: NullPointerException in FrameBuffer.dispose().
« Reply #2 on: June 22, 2013, 11:04:14 am »
I fail to see how this is supposed to happen...could you please try the latest beta http://jpct.de/download/beta/jpct_ae.jar and if it still happen, please post the log output of that version.

Offline kiffa

  • long
  • ***
  • Posts: 199
    • View Profile
Re: NullPointerException in FrameBuffer.dispose().
« Reply #3 on: June 24, 2013, 03:32:12 am »
Thanks, i will try and back soon.

Offline kiffa

  • long
  • ***
  • Posts: 199
    • View Profile
Re: NullPointerException in FrameBuffer.dispose().
« Reply #4 on: June 24, 2013, 04:58:48 am »
And, I think this is more likely caused by app code(not by engine). If so, what may the (app) code be? Please give me some points, i will check again.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: NullPointerException in FrameBuffer.dispose().
« Reply #5 on: June 24, 2013, 08:49:46 am »
The new stacktrace might help anyway...

Offline kiffa

  • long
  • ***
  • Posts: 199
    • View Profile
Re: NullPointerException in FrameBuffer.dispose().
« Reply #6 on: June 25, 2013, 09:17:34 am »
Everything goes well by now,  I will be back if the exception happens again, thanks.
« Last Edit: June 25, 2013, 09:21:45 am by kiffa »