Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a crash and clean up YACReaderFlowGL #198

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Commits on Feb 6, 2021

  1. YACReaderFlowGL::remove(): adjust the last index too

    Adjusting index of the item that is about to be removed is pointless.
    Not adjusting the last index caused an assertion failure (a crash) in
    Library built in Debug mode - when a comic other than the last in the
    current folder was deleted in ClassicComicsView with hardware
    acceleration enabled.
    vedgy committed Feb 6, 2021
    Configuration menu
    Copy the full SHA
    81e6cb0 View commit details
    Browse the repository at this point in the history
  2. Remove unused parameter from YACReaderFlowGL::insert()

    The implementation when item != -1 seems to leak images[item].texture.
    Let us remove rather than fix this unused branch.
    
    Make YACReaderFlowGL::insert()'s name argument const.
    vedgy committed Feb 6, 2021
    Configuration menu
    Copy the full SHA
    315a3e0 View commit details
    Browse the repository at this point in the history
  3. Remove YACReader3DImage::index data member

    This index was used only in YACReaderFlowGL::drawCover(). A simple
    change of this function eliminates the use.
    
    The benefits of the removal:
    * sizeof(YACReader3DImage) is 8 bytes less now, which improves CPU cache
      utilization and saves a little RAM;
    * the code, which ensured that this index member matches the index of
      the image in YACReaderFlowGL::images, can be removed now;
    * the index member can no longer get out of sync with the index of the
      image.
    
    Simplify the implementation of YACReaderFlowGL::draw().
    
    For some (most likely obsolete) reason YACReaderFlowGL::replace()
    checked if the index member matches the index of the image and handled
    the mismatch differently. I don't see how the mismatch could happen with
    the current implementation of YACReaderFlowGL and I couldn't trigger it
    during debugging. So I think this special case can be safely removed.
    vedgy committed Feb 6, 2021
    Configuration menu
    Copy the full SHA
    91986cd View commit details
    Browse the repository at this point in the history
  4. YACReaderPageFlowGL: remove a redundant assignment

    loaded[idx] is unconditionally set to true in the call to
    YACReaderFlowGL::replace() just before the removed line.
    vedgy committed Feb 6, 2021
    Configuration menu
    Copy the full SHA
    ba15672 View commit details
    Browse the repository at this point in the history