Page 1 of 1

EXCESS RELEASE OF FONT Tahoma[ hFont : 0] ( nCount : 0 )

Posted: Wed Jan 17, 2018 9:36 am
by dutch
Dear All,

I found the point of my problem case for creating logerror() file. This is TESTGET.PRG in sample folder.
I just add SBUTTON.LIB and it create a log file every time I end font object. It seem NO FONT OBJECT to :end().
01/17/2018 16:09:04: EXCESS RELEASE OF FONT Tahoma[ hFont : 0] ( nCount : 0 )
<-TFONT:END(285) <-MAIN(32)

Code: Select all

// Testing GETs

#include "FiveWin.ch"
#include "TSbutton.ch"

function Main()
   LOCAL oDlg, oGet, oFont
   LOCAL cCad := "Testing    " // pad("Testing Gets",40)
   LOCAL nNum := 0
   LOCAL dDat := Date()

   Set century On
   Set Date Ansi
   Set Date format "mm/dd/yyyy"

   SET _3DLOOK ON

   DEFINE FONT oFont NAME 'Tahoma' SIZE 0, -14

   DEFINE DIALOG oDlg TITLE "TGet from " + FWDESCRIPTION FONT oFont

   @ 1,    2 SAY "Text..:" OF oDlg
   @ 1,    6 GET oGet VAR cCad OF oDlg SIZE 60, 10 COLOR "W/G" PICTURE "@K"
   @ 1.8,  2 SAY "Number:" OF oDlg
   @ 2,    6 GET oGet VAR nNum OF oDlg SIZE 60, 10 PICTURE "9999999.99"
   @ 2.6,  2 SAY "Date:" OF oDlg
   @ 3,    6 GET oGet VAR dDat PICTURE "@E" OF oDlg SIZE 60, 10  // "@D"
   @ 3,    7 SBUTTON oBtn PROMPT "&Ok" OF oDlg SIZE 30, 12 ACTION oDlg:End()
   @ 3,   16 BUTTON "&Cancel" SIZE 30, 12 OF oDlg ACTION oDlg:End() CANCEL

   ACTIVATE DIALOG oDlg CENTERED
   oFont:End()
return nil
The problem line is ::Super:Destroy()

Code: Select all

* ============================================================================
* METHOD TSButton:Destroy() Version 7.0 Oct/31/2009
* ============================================================================

METHOD Destroy() CLASS TSButton

   ::FreeBitmaps()

   If Empty( ::cCaption )
      ::oFont := Nil
   EndIf

   If ::lAnimated

      If oAnima != Nil
         oAnima:End()
         oAnima := Nil
      EndIf

   EndIf

   ::Super:Destroy()   <-- I think, It is compatible with FWH1711

Return 0
How can I fix it?

Thank you in advance for any help and suggestion.
Dutch

Re: EXCESS RELEASE OF FONT Tahoma[ hFont : 0] ( nCount : 0 )

Posted: Wed Jan 17, 2018 9:56 am
by dutch
I've remark ::Super:Destroy(). The logerror() file is not created anymore.

What is the problem, if I do it?

Code: Select all

* ============================================================================
* METHOD TSButton:Destroy() Version 7.0 Oct/31/2009
* ============================================================================

METHOD Destroy() CLASS TSButton

   ::FreeBitmaps()

   If Empty( ::cCaption )
      ::oFont := Nil
   EndIf

   If ::lAnimated

      If oAnima != Nil
         oAnima:End()
         oAnima := Nil
      EndIf

   EndIf

//   ::Super:Destroy()

Return 0
 
Thank you in advance for any help and suggestion.
Dutch

Re: EXCESS RELEASE OF FONT Tahoma[ hFont : 0] ( nCount : 0 )

Posted: Wed Jan 17, 2018 7:40 pm
by Antonio Linares
Dutch,

Please try it this way:

Code: Select all

METHOD Destroy() CLASS TSButton

   ::FreeBitmaps()

   If Empty( ::cCaption )
      ::oFont:End() // changed
   EndIf

   If ::lAnimated

      If oAnima != Nil
         oAnima:End()
         oAnima := Nil
      EndIf

   EndIf

return ::Super:Destroy()
 

Re: EXCESS RELEASE OF FONT Tahoma[ hFont : 0] ( nCount : 0 )

Posted: Thu Jan 18, 2018 2:12 am
by dutch
It is still created logerror() file.
18/01/18 09:09:28: EXCESS RELEASE OF FONT Tahoma[ hFont : 0] ( nCount : 0 )
<-TFONT:END(285) <-TCONTROL:DESTROY(2154) <-TSBUTTON:DESTROY(971) <-TWINDOW:HANDLEEVENT(0) <-TCONTROL:HANDLEEVENT(1731) <-TSBUTTON:HANDLEEVENT(1322) <-_FWH(3348) <-DIALOGBOXINDIRECTW(0) <-TDIALOG:ACTIVATE(296)
------------------------------------------------------------
18/01/18 09:09:28: EXCESS RELEASE OF FONT Tahoma[ hFont : 0] ( nCount : -1 )
<-TFONT:END(285) <-LOGINSERVER(681) <-CONNECTSERVER(190) <-MAIN(163)
------------------------------------------------------------
I change as below.

Code: Select all

* ============================================================================
* METHOD TSButton:Destroy() Version 7.0 Oct/31/2009
* ============================================================================

METHOD Destroy() CLASS TSButton

   ::FreeBitmaps()

   If Empty( ::cCaption )
//      ::oFont := Nil
      ::oFont:End()
   EndIf

   If ::lAnimated

      If oAnima != Nil
         oAnima:End()
         oAnima := Nil
      EndIf

   EndIf

//  ::Super:Destroy()

Return ::Super:Destroy()

Re: EXCESS RELEASE OF FONT Tahoma[ hFont : 0] ( nCount : 0 )

Posted: Tue May 21, 2019 6:03 am
by Uwe.Diemer
Any News ??

After using sbutton the font of sbutton is changed


Before

http://prntscr.com/nr8o6h

Image

After

http://prntscr.com/nr8nqy


tx