react-native-image-sequence icon indicating copy to clipboard operation
react-native-image-sequence copied to clipboard

Calling RNImage Sequence subsequently after a setTimeOut causes memory leak

Open a4averma opened this issue 6 years ago • 1 comments

Consider the following example

Screen one

class LoadingScreen extends React.Component {
  componentDidMount() {
    setTimeout(() => {
      if (this.props.hasLoggedIn && this.props.hasDevices) {
        this.props.navigation.navigate("Main");
      } else if (this.props.hasLoggedIn && !this.props.hasDevices) {
        this.props.navigation.navigate("RegisterDevice");
      } else {
        this.props.navigation.navigate("BeMain");
      }
    }, 2500);
  }
  render() {
    return (
        <View style={styles.container}>
          <ImageSequence
            images={images}
            startFrameIndex={0}
            style={{
              width: 200,
              height: 200,
              alignSelf: "center"
            }}
          />
          <Spinner />
        </View>
    );
  }
}

Screen Two

export default class MainScreen extends React.Component {
  render() {
    return (
        <View style={styles.container}>
          <ImageSequence
            images={images}
            startFrameIndex={0}
            style={{ width: 150, height: 150 }}
          />
    );
  }
}

This causes a crash in signed release variant of the app. Debug app seems to work fine. How do I resolve this?

a4averma avatar Mar 12 '19 07:03 a4averma

Hi could you attach the error message?

madsleejensen avatar Apr 25 '19 10:04 madsleejensen