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

Post Reply
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

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

Post 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
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

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

Post 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
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

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

Post 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()
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

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

Post 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()
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
Uwe.Diemer
Posts: 81
Joined: Mon Aug 09, 2010 11:00 am

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

Post 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
Post Reply