Global Mapper Pro

Error during GM_LoadLayerList() is leaving file handle open

jfergus
jfergus Global Mapper User
edited January 2013 in Bug Report
Hi, I'm using C# in a Windows Forms app built in VS 2010. I have a scenario where I'm invoking a call to GM_LoadLayerList() on a file that I know is badly formatted, and as expected the DLL is returning a GM_Error_LoadError. My application then attempts to delete the file and it's getting an error because the DLL apparently opens the file, dislikes the format, returns an error code but doesn't close the file.

Is there an option I can set or a means by which I can get the file to close?

Thanks!

Comments

  • global_mapper
    global_mapper Administrator
    edited January 2013
    What format is the file? Most of the loaders should close it properly, but it's certainly possible there is one that doesn't close properly when it fails to load.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.bluemarblegeo.com/products/global-mapper.php
  • jfergus
    jfergus Global Mapper User
    edited January 2013
    The file is a TIF. At startup the application copies a number of files off a network drive to a local folder in which each file is processed. I believe there was a network "glitch" during the copy which corrupted this file, because it's perfectly okay at the network source. I suspect the "half baked"/corrupted version is probably generating an internal exception or causing the instruction path to head down an unexpected path.

    In any event, it's not a huge problem, as I can manually delete the file when the application terminates. Ideally, though, the application can perform the necessary cleanup, because then I could attempt to re-retrieve a file that fails to see if the retry can correct it. This application is a long-running batch-like app which often runs overnight or over the weekend, so error-detection/correction logic would be beneficial in this scenario.

    Thanks for any suggestions/information you can provide!
  • global_mapper
    global_mapper Administrator
    edited January 2013
    Which version of the SDK do you have? I was able to find the problem and make the file handle close when the TIFF format can't be verified. I can make a new build of the v14 SDK with that change if you are on that.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.bluemarblegeo.com/products/global-mapper.php
  • jfergus
    jfergus Global Mapper User
    edited January 2013
    GM_GetSDKVersion() returns 135.
  • global_mapper
    global_mapper Administrator
    edited January 2013
    That is an older one. You can contact gmorders@bluemarblegeo.com and they can work with you to upgrade your SDK. The change to release the TIFF file handle will be in the SDK v14.1 release next week.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.bluemarblegeo.com/
  • jfergus
    jfergus Global Mapper User
    edited January 2013
    Awesome, thank you, Mike!
Sign In or Register to comment.