darryncampbell / react-native-datawedge-intents

React Native interface for Zebra's DataWedge Intent API
MIT License
43 stars 46 forks source link

fixing leak genericReceiver when react-native devtools reload #8

Closed hkthea closed 4 years ago

hkthea commented 4 years ago

this issued produced when we reload react-native, it duplicated

first time image

reload image

2nd reload image

darryncampbell commented 4 years ago

Thank you for the submission. If you unregister the broadcast receiver in onHostPause() wouldn't you also need to re-register the receiver in onHostResume()?

I did not unregister / reregister and that is what the following note refers to:

      //  Note regarding registerBroadcastReceiver:
      //  This module makes no attempt to unregister the receiver when the application is paused and re-register the
      //  receiver when the application comes to the foreground.  Feel free to fork and add this logic to your solution if
      //  required - I have found in the past this has led to confusion.

Does that make sense? I apologise but I haven't looked at this code in 15 months

hkthea commented 4 years ago

Hi darryn, thanks for your answer. this problem come from react-native

https://github.com/facebook/react-native/issues/9773

this dev issued. but i didn't see how to resolve.