#11 BUGFIX: Sync issue in ConsoleView

closed
nobody
None
5
2007-04-22
2006-06-30
jachymko_
No

hi,

i found a little bug when you are resizing the window
too fast, the console sometimes fails to
ATLASSERT(someBmp != NULL), since the
ConsoleView::RepaintText is trying to use the
offscreen buffers when they're recycled.

i hope this code fixes it. just add the attached
CriticalSection.h into the project (or rather use some
built-in ATL class, if there is one, i dont know), and

1. include CriticalSection.h into the ConsoleView.h

2. add a private static critical section to the
ConsoleView class:

private:

static CriticalSection  m_bufferLock;

3. add an implementation for it in the .cpp

CriticalSection ConsoleView::m_bufferLock;

4. and modify the

RepaintText(),
RepaintTextChanges(),
CreateOffscreenBuffers() and
RecreateOffscreenBuffers()

methods so they begin with the following statement:

CCritSecLock lock(m_bufferLock);

Discussion

  • jachymko_

    jachymko_ - 2006-06-30

    CRITICAL_SECTION C++ wrapper

     
  • Marko Bozikovic

    Marko Bozikovic - 2006-06-30

    Logged In: YES
    user_id=16767

    O, I'll try to reproduce the bug and test your bugfix.

     
  • Marko Bozikovic

    Marko Bozikovic - 2007-04-22
    • status: open --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks