Official eMule-Board: Weird Crash... Minimule? - Official eMule-Board

Jump to content


Page 1 of 1

Weird Crash... Minimule? Re-Visited!!!

#1 User is offline   BlueSonicBoy 

  • Magnificent Member
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 396
  • Joined: 26-September 04

Posted 11 September 2005 - 02:48 AM

Hi

I know this is a probably a stupid question, and I freely admit I know nothing about
CDHtmlDialog. As a further caveat, my system is old and flakey.

Question: Does this
{
	if (m_pMiniMule)
	{
  if (!m_pMiniMule->IsInCallback()) // for safety
  {
  	m_pMiniMule->DestroyWindow();
  	delete m_pMiniMule;
  	m_pMiniMule = NULL;
  }
  else
  	ASSERT(0);
	}


protect minimule from begin destroyed after it is created and before it it shown/visible? Given:

	//m_pMiniMule->ShowWindow(SW_SHOW);	// do not explicitly show the window, it will do that for itself when it's ready..

As more than once when my system was compiling or doing a lot of work I have given the emule systray icon a burst of left clicks and it's crashed with at access violation, when I have debugged it, it looked a little llike the minimule object had been accessed after it was destroyed....

Probably, just my flakey old system, it does well though as it's run for years and is hardly ever turned off... :)

This post has been edited by BlueSonicBoy: 18 October 2005 - 01:47 AM

0

#2 User is offline   SiRoB 

  • Retired Morph Dev
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1691
  • Joined: 28-June 03

Posted 13 September 2005 - 05:04 PM

I avoid this by removing the official patch and make this:

Quote

void CMiniMule::OnDocumentComplete(LPDISPATCH pDisp, LPCTSTR pszUrl)
{
CCounter cc(m_iInCallback);


minimule can stay open even if emule is restored but there is no more crash. ;)
eMule 0.47c MorphXT v9.5 ::binary::source::
0

#3 User is offline   BlueSonicBoy 

  • Magnificent Member
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 396
  • Joined: 26-September 04

Posted 14 September 2005 - 02:42 AM

SiRoB, on Sep 13 2005, 05:04 PM, said:

I avoid this by removing the official patch and make this:

Quote

void CMiniMule::OnDocumentComplete(LPDISPATCH pDisp, LPCTSTR pszUrl)
{
CCounter cc(m_iInCallback);


minimule can stay open even if emule is restored but there is no more crash. ;)
View Post


:respect:

I hadn't even looked at that piece of code...

Thank you for your fix!
0

#4 User is offline   BlueSonicBoy 

  • Magnificent Member
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 396
  • Joined: 26-September 04

Posted 18 October 2005 - 02:10 AM

SiRoB, on Sep 13 2005, 12:04 PM, said:

I avoid this by removing the official patch and make this:

Quote

void CMiniMule::OnDocumentComplete(LPDISPATCH pDisp, LPCTSTR pszUrl)
{
CCounter cc(m_iInCallback);


minimule can stay open even if emule is restored but there is no more crash. ;)
View Post


I applied the above fix and all seemed well, then tonight I double clicked my taskbar eMule icon and it crashed! Debugging; it looked like deletion of minimule might be to blame again? I still know nothing about the workings of CDHtmlDialog other than it's sounds a little too M$.

So I am thinking the code change below in void CemuleDlg::RestoreWindow() might be a simple fix for the problem?

void CemuleDlg::RestoreWindow() said:

if( m_pMiniMule ){ //Fix double click crash
      if( m_pMiniMule->IsWindowVisible() ) DestroyMiniMule();
    }

0

#5 User is offline   tHeWiZaRdOfDoS 

  • Man, what a bunch of jokers...
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5630
  • Joined: 28-December 02

Posted 18 October 2005 - 10:50 AM

I'd suggest a simpler way for the minimule...
First of all, create it ONCE with new in eMule.cpp and delete it ONCE in eMuleDlg.cpp like with all other windows - this will take (a very small) amount of memory but has advantages:

- saving of NULL-pointer checks all around
- crashes due to them ^^ aren't possible any more
- minimule will pop up faster on click (right now it takes pretty long if you're doing something like watching a video or else)
0

  • Member Options

Page 1 of 1

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users