Author Topic: OnApplicationPause resulting in duplicate OnClick()  (Read 3803 times)

ferretnt

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 23
    • View Profile
OnApplicationPause resulting in duplicate OnClick()
« on: May 21, 2014, 05:32:00 PM »
We have several buttons which result in launching external iOS dialogs. Most of these call UnityPause(), which in turn results in OnApplicationPause() being called, which then makes a second call into Objective-C functions that aren't safely re-entrant (i.e. displaying a viewcontroller again.)

It's a lot of work to fix up all of these functions (which we didn't write.) Can we safely prevent this duplicate call?

Thanks,
Alex

Tex-Twil

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Re: OnApplicationPause resulting in duplicate OnClick()
« Reply #1 on: June 02, 2015, 06:31:54 AM »
Hello,
I have exactly the same problem. The "second" click is caused by the "UnityPlayerLoop()" called from "UnityAppController applicationWillResignActive"

What is a proper way to fix this?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: OnApplicationPause resulting in duplicate OnClick()
« Reply #2 on: June 07, 2015, 12:15:31 PM »
This would be something to ask Unity as it has nothing to do with NGUI.