镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Queue as member variable breaks my program #135

Open

Description

@benjibst

While trying to make my Video to ascii program multithreaded, by adding this queue i created a bug that i just cant fix and i figured out what is causing it just now.
Whenever i have a queue as a member variable in my class an error occurs, and if i comment the member variable declaration out it doesnt happen anymore.
Also you can criticize my code overall if you want, im learning

Here is a video of me reproducing this:
https://drive.google.com/file/d/11Y6_ug_H8E413T8e7YkKXet7-9SUaeCH/view?usp=sharing

Pls help me fixing this bug, here is the code on github:
https://github.com/BetterRage/Movie2Ascii.git

To build it you need ffmpeg, SDL, and spdlog

Activity

  1. cameron314 commented on Sep 9, 2022

    @cameron314
    Owner

    If simply adding the unused queue member to your class causes this bug, as seen in the video, then there's almost certainly undefined behaviour elsewhere in your program, unrelated to the queue itself, that just happens to present itself when the memory layout changes due to the inclusion of the queue.

  2. benjibst commented on Sep 9, 2022

    @benjibst
    Author

    Thanks for the answer, i will try to fix it.
    My temporary fix was to just store the queue somewhere else but thats not a really good solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions