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

[Bug] Fix end-of-life of m_connectThread properly [sf#497] #30

Open
openMSX-import opened this issue Jun 24, 2015 · 1 comment
Open

Comments

@openMSX-import
Copy link

Reported by joxy on 2013-08-17 19:04 UTC

commit ada1033e487c51b6cb1f9da58aaebb850a135efe
Author: wouter
Date:   Sat Aug 17 10:52:16 2013 +0200

    Hack: don't delete m_connectThread

    Vampier reported a crash on exit. This was in windows-specific code while
    destroying the m_connectThread object. I recently added this because before it
    was leaked. Though a leak is better than a crash, so I restored the old
    behavior. It's not a big leak: only a few kB (or less?) each time openMSX is
    stopped. Someone with a deeper understanding of wxWidgets could look into
    this, but for me this is low priority.

diff --git a/src/openMSXController.cpp b/src/openMSXController.cpp
--- a/src/openMSXController.cpp
+++ b/src/openMSXController.cpp
@@ -104,7 +104,8 @@ void openMSXController::HandleEndProcess(wxCommandEvent& event)

 #ifdef __WXMSW__
    if (!m_pipeActive) {
-       m_connectThread.reset();
+       // m_connectThread.reset(); // TODO why does this crash?
+       m_connectThread.release();  // this is a memory leak
    }
 #else
    close(m_openMSXstdin);

EGP writes: I kinda love both low-level debugging and also love debugging and fixing thread issues, so I'll open a ticket for me WRT this issue.

@openMSX-import
Copy link
Author

Commented by joxy on 2013-08-17 19:05 UTC
Related ticket : http://sourceforge.net/p/openmsx/bugs/496/

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

No branches or pull requests

1 participant