Author Topic: Bug in 3.0.9 f 3  (Read 7644 times)

Jonu

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Bug in 3.0.9 f 3
« on: January 22, 2014, 06:34:45 AM »
Application is crashing when you are closing it on IOS and Android devices.

This is the error:

NullReferenceException
at UnityEngine.Component.get_gameObject () [0x00000] in <filename unknown>:0
at UIDrawCall.ClearAll () [0x00000] in <filename unknown>:0
at UIDrawCall.ReleaseAll () [0x00000] in <filename unknown>:0
at UIPanel.OnDisable () [0x00000] in <filename unknown>:0




Redd

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 1
  • Posts: 10
    • View Profile
Re: Bug in 3.0.9 f 3
« Reply #1 on: January 22, 2014, 02:38:34 PM »
I have the same bug, please add a null object check.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Bug in 3.0.9 f 3
« Reply #2 on: January 22, 2014, 09:27:56 PM »
Did you try it in f4?

Jonu

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: Bug in 3.0.9 f 3
« Reply #3 on: January 23, 2014, 06:13:09 AM »
Did you try it in f4?

I tried that and it is still crashing.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Bug in 3.0.9 f 3
« Reply #4 on: January 23, 2014, 06:14:49 AM »
Try changing UIDrawCall.ClearAll and ReleaseAll to these:
  1.         /// <summary>
  2.         /// Clear all draw calls.
  3.         /// </summary>
  4.  
  5.         static public void ClearAll ()
  6.         {
  7.                 bool playing = Application.isPlaying;
  8.  
  9.                 for (int i = mActiveList.size; i > 0; )
  10.                 {
  11.                         UIDrawCall dc = mActiveList[--i];
  12.  
  13.                         if (dc)
  14.                         {
  15.                                 if (playing) NGUITools.SetActive(dc.gameObject, false);
  16.                                 else NGUITools.DestroyImmediate(dc.gameObject);
  17.                         }
  18.                 }
  19.                 mActiveList.Clear();
  20.         }
  21.  
  22.         /// <summary>
  23.         /// Immediately destroy all draw calls.
  24.         /// </summary>
  25.  
  26.         static public void ReleaseAll ()
  27.         {
  28.                 ClearAll();
  29.  
  30.                 for (int i = mInactiveList.size; i > 0; )
  31.                 {
  32.                         UIDrawCall dc = mInactiveList[--i];
  33.                         if (dc) NGUITools.DestroyImmediate(dc.gameObject);
  34.                 }
  35.                 mInactiveList.Clear();
  36.         }

Jonu

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: Bug in 3.0.9 f 3
« Reply #5 on: January 23, 2014, 06:27:09 AM »
It started worked with this code change

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Bug in 3.0.9 f 3
« Reply #6 on: January 23, 2014, 06:28:21 AM »
Perfect, thanks. I'll add it in the next update.