This happens %100 of the time when reloading a cbp file when it changes. (Compiled at head: r10373)
ASSERT INFO:
../src/common/wincmn.cpp(461): assert "!wxMouseCapture::IsInCaptureStack(this)" failed in ~wxWindowBase(): Destroying window before releasing mouse capture: this will result in a crash later.
BACKTRACE:
[1] wxWindowBase::~wxWindowBase()
[2] wxControlBase::~wxControlBase()
[3] cbStyledTextCtrl::~cbStyledTextCtrl()
[4] wxWindowBase::Destroy()
[5] cbEditor::~cbEditor()
[6] cbEditor::~cbEditor()
[7] wxWindowBase::Destroy()
[8] wxAuiNotebook::DeletePage(unsigned long)
[9] cbAuiNotebook::DeletePage(unsigned long)
[10] EditorManager::Close(EditorBase, bool)
[11] cbProject::CloseAllFiles(bool)
[12] ProjectManager::CloseProject(cbProject, bool, bool)
[13] ProjectManager::ReloadProject(cbProject)
[14] ~wxFileName /usr/include/wx-3.0/wx/filename.h:126
[15] ~wxCommandEvent /usr/include/wx-3.0/wx/event.h:1530
[16] wxAppConsoleBase::CallEventHandler(wxEvtHandler, wxEventFunctor&, wxEvent&) const
[17] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler, wxEvent&)
[18] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler)
[19] wxEvtHandler::TryHereOnly(wxEvent&)
[20] wxEvtHandler::ProcessEventLocally(wxEvent&)
[21] wxEvtHandler::ProcessEvent(wxEvent&)
[22] wxAppBase::SetActive(bool, wxWindow)
[23] wxFrameBase::OnInternalIdle()
[24] wxWindowBase::SendIdleEvents(wxIdleEvent&)
[25] wxFrame::SendIdleEvents(wxIdleEvent&)
[26] wxAppBase::ProcessIdle()
[27] wxApp::DoIdle()
[28] g_main_context_dispatch
[29] g_main_loop_run
[30] gtk_main
[31] wxGUIEventLoop::DoRun()
[32] wxEventLoopBase::Run()
[33] wxAppConsoleBase::MainLoop()
[34] CodeBlocksApp::OnRun() /home/john/third_party/codeblocks/src/src/app.cpp:852
[35] wxEntry(int&, wchar_t*)
[36] main /home/john/third_party/codeblocks/src/src/app.cpp:322
[37] __libc_start_main
[38] _start
Actually, it only seems to happen when I've got a source file open. If I close all source files it seems to be OK when I change the cbp and then change focus to codeblocks.
So what are the exact steps to reproduce the problem?
Use touch my.cbp file why this cbp file is still opened?
Also what OS and wx version are you using?
Tried using touch and I cannot reproduce this problem. :(
'touch' on the cbp does it for me. I just tried a bunch of times and had it not do it once with one source file open. But with that exception, if I've got any files open, the moment I click the 'Yes' button on the 'Reload Project?' modal dialog, I get the assert.
I should say that I've got a fairly complicated CMake setup. Having said that, this seems like it's coming out of GUI code so it shouldn't matter.
Version information follows.
~/ $ uname -a
Linux CoolerMaster 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
~/ $ cat /etc/*-release
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=17.1
DISTRIB_CODENAME=rebecca
DISTRIB_DESCRIPTION="Linux Mint 17.1 Rebecca"
NAME="Ubuntu"
VERSION="14.04.1 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.1 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
cat: /etc/upstream-release: Is a directory
~ $ dpkg -l | grep wx
ii libwxbase2.8-0:amd64 2.8.12.1+dfsg-2ubuntu2 amd64 wxBase library (runtime) - non-GUI support classes of wxWidgets toolkit
ii libwxbase3.0-0:amd64 3.0.0-2 amd64 wxBase library (runtime) - non-GUI support classes of wxWidgets toolkit
ii libwxbase3.0-0-dbg:amd64 3.0.0-2 amd64 debugging symbols for the wxBase library
ii libwxbase3.0-dev 3.0.0-2 amd64 wxBase library (development) - non-GUI support classes of wxWidgets toolkit
ii libwxgtk2.8-0:amd64 2.8.12.1+dfsg-2ubuntu2 amd64 wxWidgets Cross-platform C++ GUI toolkit (GTK+ runtime)
ii libwxgtk3.0-0:amd64 3.0.0-2 amd64 wxWidgets Cross-platform C++ GUI toolkit (GTK+ runtime)
ii libwxgtk3.0-0-dbg 3.0.0-2 amd64 debugging symbols for the wxGTK GUI toolkit library
ii libwxgtk3.0-dev 3.0.0-2 amd64 wxWidgets Cross-platform C++ GUI toolkit (GTK+ development)
rc libwxsqlite3-2.8-0:amd64 3.0.6.1~dfsg0-2 amd64 SQLite3 C++ wrapper for use in programs based on the wxWidgets
ii wx-common 3.0.0-2 amd64 wxWidgets Cross-platform C++ GUI toolkit (common support files)
ii wx3.0-headers 3.0.0-2 amd64 wxWidgets Cross-platform C++ GUI toolkit (header files)
Some more info:
When I click on CodeBlocks after touching the cbp file, the problem only occurs when I transfer focus by clicking on a source file. If I click on the project (Management?) pane, it's fine. It's also fine if I click on the pane at the bottom (Log & others).
Can you post the output of this command: ldd /usr/bin/codeblocks | grep wx ?
Do you have the cb window and the terminal side by side when you reproduce the problem?
Can you record me a video or share some minimal project that can be used to reproduce the problem?
~ $ ldd /usr/bin/codeblocks | grep wx
libwx_gtk2u_aui-2.8.so.0 => /usr/lib/x86_64-linux-gnu/libwx_gtk2u_aui-2.8.so.0 (0x00007fd4b32fa000)
libwx_gtk2u_xrc-2.8.so.0 => /usr/lib/x86_64-linux-gnu/libwx_gtk2u_xrc-2.8.so.0 (0x00007fd4b3063000)
libwx_gtk2u_qa-2.8.so.0 => /usr/lib/x86_64-linux-gnu/libwx_gtk2u_qa-2.8.so.0 (0x00007fd4b2e42000)
libwx_gtk2u_html-2.8.so.0 => /usr/lib/x86_64-linux-gnu/libwx_gtk2u_html-2.8.so.0 (0x00007fd4b2b96000)
libwx_gtk2u_adv-2.8.so.0 => /usr/lib/x86_64-linux-gnu/libwx_gtk2u_adv-2.8.so.0 (0x00007fd4b28ba000)
libwx_gtk2u_core-2.8.so.0 => /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-2.8.so.0 (0x00007fd4b22d9000)
libwx_baseu_net-2.8.so.0 => /usr/lib/x86_64-linux-gnu/libwx_baseu_net-2.8.so.0 (0x00007fd4b20ab000)
libwx_baseu-2.8.so.0 => /usr/lib/x86_64-linux-gnu/libwx_baseu-2.8.so.0 (0x00007fd4b1d5e000)
libwx_gtk2u_aui-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_gtk2u_aui-3.0.so.0 (0x00007fd4b06ca000)
libwx_gtk2u_xrc-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_gtk2u_xrc-3.0.so.0 (0x00007fd4b03cc000)
libwx_gtk2u_html-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_gtk2u_html-3.0.so.0 (0x00007fd4b0104000)
libwx_gtk2u_adv-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_gtk2u_adv-3.0.so.0 (0x00007fd4afd2c000)
libwx_gtk2u_core-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0 (0x00007fd4af56d000)
libwx_baseu_xml-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_baseu_xml-3.0.so.0 (0x00007fd4af35c000)
libwx_baseu_net-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_baseu_net-3.0.so.0 (0x00007fd4af113000)
libwx_baseu-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0 (0x00007fd4aec8e000)
libwx_baseu_xml-2.8.so.0 => /usr/lib/x86_64-linux-gnu/libwx_baseu_xml-2.8.so.0 (0x00007fd4ae1c2000)
Let me work on the video / minimal project.
Here's a video. There's no sound.
I cannot reproduce it.
How have you built cb? The dependencies look rather suspicious.
You're mixing wx3 and wx2, which is always going to end in some kind of disaster.
Last edit: Teodor Petrov 2015-08-02
I'm building following the instructions in the BUILD file at the root of the source tree from the tip of trunk. I had to intall some packages to make it build, but don't recall if I did a complete clean, so I just redid everything and I'm getting the same thing.
I realize that 'make install' puts the binary in /usr/local/bin, not /usr/bin, so the output from ldd in the comment above is wrong. The correct output is as follows:
~ $ ldd /usr/local/bin/codeblocks | grep wx
libwx_gtk2u_aui-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_gtk2u_aui-3.0.so.0 (0x00007ffa7111d000)
libwx_gtk2u_propgrid-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_gtk2u_propgrid-3.0.so.0 (0x00007ffa70e3a000)
libwx_gtk2u_xrc-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_gtk2u_xrc-3.0.so.0 (0x00007ffa70b3c000)
libwx_gtk2u_html-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_gtk2u_html-3.0.so.0 (0x00007ffa70875000)
libwx_gtk2u_qa-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_gtk2u_qa-3.0.so.0 (0x00007ffa7064e000)
libwx_gtk2u_adv-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_gtk2u_adv-3.0.so.0 (0x00007ffa70276000)
libwx_gtk2u_core-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0 (0x00007ffa6fab7000)
libwx_baseu_net-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_baseu_net-3.0.so.0 (0x00007ffa6f86d000)
libwx_baseu-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0 (0x00007ffa6f3e8000)
libwx_baseu_xml-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_baseu_xml-3.0.so.0 (0x00007ffa6e660000)
So everything wx is 3.0.
Hm, now I can reproduce it. Probably I've not tested correctly.
Fixed in rev 10523.
Thank you for reporting it.
Thanks. Fix works for me.