replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - A callback was made on a garbage collected delegate
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

A callback was made on a garbage collected delegate

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
alex21



Joined: 20 Apr 2011
Posts: 75
Location: Australia

PostPosted: Tue Jul 05, 2011 5:57 am    Post subject: A callback was made on a garbage collected delegate Reply with quote

Hello,

I have had some what of a sucess implementing a WPF .Net 4.0 GUI for my old FORTRAN95 console application, however I have recently come across this error which I don't have a clue about when trying to call a function in FORTRAN code.

Error:
Code:
A callback was made on a garbage collected delegate of type 'ftn95lib.mdl!Salford.Fortran.RTLibrary+clearwin_callback::Invoke'. This may cause application crashes, corruption and data loss. When passing delegates to unmanaged code, they must be kept alive by the managed application until it is guaranteed that they will never be called.


The above is just a warning, I then recieve a NullReferenceException, and what appears to be null is the FORTRAN function itself...

FORTRAN Function:
Code:
FUNCTION CheckInputFormatsFunc(InputParser, cLine, noVars)
    USE ZE
    USE FTNHelper
    IMPLICIT NONE

    ASSEMBLY_INTERFACE(NAME="CheckInputFormatsFunc")

    OBJECT("System.String[]") :: CheckInputFormatsFunc
    OBJECT("WinTransform.DataModel.Parser"), INTENT(IN) :: InputParser
    STRING, INTENT(IN) :: cLine
    INTEGER, INTENT(IN) :: noVars

    CheckInputFormatsFunc = NEW@("System.String[]", 0)
END FUNCTION CheckInputFormatsFunc


.Net Call:
Code:
Public ReadOnly Property InputFileColumnsOutput As String
            Get
                If InputFile Is Nothing Then
                    Return String.Empty
                End If
                Dim test = New List(Of String)
                Dim mOutCols = WinTransformUtility.CheckInputFormatsFunc(Source, InputFileParseLine, InputVariables.Count)
                Return String.Join(" ", mOutCols)
            End Get
        End Property


However after recieving the afore mentioned warning I get a NullReferenceException on this line:
Code:
CheckInputFormatsFunc = NEW@("System.String[]", 0)


Can someone please explain why this might be happening?

Thanks,
Alex.
Crying or Very sad
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group