Author Topic: Fix ThreadSearch bug: all the items were deleted  (Read 4889 times)

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Fix ThreadSearch bug: all the items were deleted
« on: April 06, 2010, 04:34:25 pm »
The current ThreadSearch plugin code has a miner bug:

After the search session, When I try to drag the title bar of the result panel to stretch the window size, all the search result get re-flashed and lost.

I guess the related code is in:

Quote
void ThreadSearchView::Update()
{
...
    m_pLogger->Update(); /* delete this line*/
}
Then, in this Update() function, a function below will  finally  be called.

Quote
void ThreadSearchLoggerList::Clear()
{
    m_pListLog->DeleteAllItems();
    m_IndexManager.Reset();
    m_IndexOffset = 0;
}
Then, all the items were deleted.
If we delete this statement, we can fix this bug. What's your opinion? Jens.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7253
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Fix ThreadSearch bug: all the items were deleted
« Reply #1 on: April 06, 2010, 10:47:45 pm »
If we delete this statement, we can fix this bug. What's your opinion? Jens.

I can not reproduce the problem (linux).
I know that all search-results get deleted if the configuration-dialog ends.

Can you tell me exactly what you do before this happens (tree or list, logger or free-floating ...) ?
Do you use a clean ThreadSearch or did you make any changes or did you apply any patches ?

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Fix ThreadSearch bug: all the items were deleted
« Reply #2 on: April 07, 2010, 03:31:41 am »
My OS is XPSP3.
Here are same question report: http://forums.codeblocks.org/index.php/topic,11850.0.html

The picture below is my ThreadSearch configs.
NOT apply any patch, ONLY SVN 6202.

[attachment deleted by admin]
« Last Edit: April 07, 2010, 03:44:01 am by Loaden »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5234
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Fix ThreadSearch bug: all the items were deleted
« Reply #3 on: April 07, 2010, 03:59:18 am »
I can confirm this bug, please notice that this bug is related to this option:
Quote
ThreadSearch panel managed by Layout
:D, if it is embedded in the Message notebook, there is no such problem.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Fix ThreadSearch bug: all the items were deleted
« Reply #4 on: April 07, 2010, 04:11:01 am »
:D, if it is embedded in the Message notebook, there is no such problem.
Yes, I can confirm it.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7253
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Fix ThreadSearch bug: all the items were deleted
« Reply #5 on: April 07, 2010, 08:04:52 am »
Still does not happen to me.

Win XP SP3
TDM gcc 4.4.0
wxWidgets 2.8.10 windows unicode
no language files

I have the exactly same settings and also does not show window content while dragging or resiszing (the last is a window setting).

ThreadSearchView::Update() is called at two places: ThreadSearch::OnAttach() and ThreadSearch::Notify().
The first should only be called if the plugin gets attached, the second is only called if the configuration-dialog ends and the settings get applied.

Can you set a breakpoint at the beginning of the ThreadSearchView::Update()-function and post the (relevant part of the) call-stack ?

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Fix ThreadSearch bug: all the items were deleted
« Reply #6 on: April 07, 2010, 08:34:09 am »
Maybe it's wxWidgets's BUG?
Quote
#0 00000000   ThreadSearchView::Update(this=0x37c4290) (D:\DengYC\CodeBlocks\src\plugins\contrib\ThreadSearch\ThreadSearchView.cpp:608)
#1 68716955   wxmsw28u!_ZN12wxAuiManager6UpdateEv() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#2 68716D50   wxmsw28u!_ZN12wxAuiManager17DoEndResizeActionER12wxMouseEvent() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#3 687170EE   wxmsw28u!_ZN12wxAuiManager8OnLeftUpER12wxMouseEvent() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#4 684FAF91   wxmsw28u!_ZN12wxEvtHandler21ProcessEventIfMatchesERK21wxEventTableEntryBasePS_R7wxEvent() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#5 684FC6BB   wxmsw28u!_ZN16wxEventHashTable11HandleEventER7wxEventP12wxEvtHandler() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#6 684FC78C   wxmsw28u!_ZN12wxEvtHandler12ProcessEventER7wxEvent() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#7 684FC729   wxmsw28u!_ZN12wxEvtHandler12ProcessEventER7wxEvent() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#8 684FC729   wxmsw28u!_ZN12wxEvtHandler12ProcessEventER7wxEvent() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#9 684FC729   wxmsw28u!_ZN12wxEvtHandler12ProcessEventER7wxEvent() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#10 684FC729   wxmsw28u!_ZN12wxEvtHandler12ProcessEventER7wxEvent() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#11 684FC729   wxmsw28u!_ZN12wxEvtHandler12ProcessEventER7wxEvent() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#12 684FC729   wxmsw28u!_ZN12wxEvtHandler12ProcessEventER7wxEvent() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#13 684FC729   wxmsw28u!_ZN12wxEvtHandler12ProcessEventER7wxEvent() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#14 684FC729   wxmsw28u!_ZN12wxEvtHandler12ProcessEventER7wxEvent() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#15 684FC729   wxmsw28u!_ZN12wxEvtHandler12ProcessEventER7wxEvent() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#16 684FC729   wxmsw28u!_ZN12wxEvtHandler12ProcessEventER7wxEvent() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#17 684FC729   wxmsw28u!_ZN12wxEvtHandler12ProcessEventER7wxEvent() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#18 684FC729   wxmsw28u!_ZN12wxEvtHandler12ProcessEventER7wxEvent() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#19 684FC729   wxmsw28u!_ZN12wxEvtHandler12ProcessEventER7wxEvent() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#20 684FC729   wxmsw28u!_ZN12wxEvtHandler12ProcessEventER7wxEvent() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#21 684FC729   wxmsw28u!_ZN12wxEvtHandler12ProcessEventER7wxEvent() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#22 684FC729   wxmsw28u!_ZN12wxEvtHandler12ProcessEventER7wxEvent() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#23 684FC729   wxmsw28u!_ZN12wxEvtHandler12ProcessEventER7wxEvent() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#24 684FC729   wxmsw28u!_ZN12wxEvtHandler12ProcessEventER7wxEvent() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#25 684FC729   wxmsw28u!_ZN12wxEvtHandler12ProcessEventER7wxEvent() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#26 684FC729   wxmsw28u!_ZN12wxEvtHandler12ProcessEventER7wxEvent() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#27 684FC729   wxmsw28u!_ZN12wxEvtHandler12ProcessEventER7wxEvent() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#28 684FC729   wxmsw28u!_ZN12wxEvtHandler12ProcessEventER7wxEvent() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)
#29 684FC729   wxmsw28u!_ZN12wxEvtHandler12ProcessEventER7wxEvent() (D:\DengYC\LoveDEV\sdk\wx\lib\gcc_dll\wxmsw28u.dll:??)