Changeset 1322:e0723b684248


Ignore:
Timestamp:
10/02/09 09:28:12 (10 months ago)
Author:
Howard Butler <hobu.inc@…>
Branch:
1.2
Message:

return types for those functions returning char *'s. It's unclear who's freeing them. ctypes seems to choke when I manually free them, so I wonder if it is doing it as it makes the returned string

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/liblas/core.py

    r1308 r1322  
    9494        raise LASException(msg) 
    9595    retval = ctypes.string_at(result)[:] 
    96     free(result) 
     96 
     97    # these might end up being double frees, I don't know why 
     98    # free(result) 
    9799    return retval 
    98100 
     
    101103    size = ctypes.c_int() 
    102104    retvalue = ctypes.string_at(result) 
    103     free(result) 
     105     
     106    # these might end up being double frees, I don't know why 
     107    # free(result) 
    104108    return retvalue 
    105      
    106      
    107  
    108 try: 
    109     from numpy import array, ndarray 
    110     HAS_NUMPY = True 
    111 except ImportError: 
    112     HAS_NUMPY = False 
    113109 
    114110if os.name == 'nt': 
     
    303299las.LASHeader_GetFileSignature.argtypes = [ctypes.c_void_p] 
    304300las.LASHeader_GetFileSignature.errcheck = check_value_free 
     301las.LASHeader_GetFileSignature.restype = ctypes.c_char_p 
    305302 
    306303las.LASHeader_GetFileSourceId.restype = ctypes.c_ushort 
     
    310307las.LASHeader_GetProjectId.argtypes = [ctypes.c_void_p] 
    311308las.LASHeader_GetProjectId.errcheck = check_value_free 
     309las.LASHeader_GetProjectId.restype = ctypes.c_char_p 
    312310 
    313311las.LASHeader_GetVersionMajor.restype = ctypes.c_ubyte 
     
    327325las.LASHeader_GetSystemId.argtypes = [ctypes.c_void_p] 
    328326las.LASHeader_GetSystemId.errcheck = check_value_free 
     327las.LASHeader_GetSystemId.restype = ctypes.c_char_p 
    329328las.LASHeader_SetSystemId.restype = ctypes.c_int 
    330329las.LASHeader_SetSystemId.argtypes = [ctypes.c_void_p, ctypes.c_char_p] 
     
    333332las.LASHeader_GetSoftwareId.argtypes = [ctypes.c_void_p] 
    334333las.LASHeader_GetSoftwareId.errcheck = check_value_free 
     334las.LASHeader_GetSoftwareId.restype = ctypes.c_char_p 
    335335las.LASHeader_SetSoftwareId.restype = ctypes.c_int 
    336336las.LASHeader_SetSoftwareId.argtypes = [ctypes.c_void_p, ctypes.c_char_p] 
     
    484484las.LASGuid_AsString.argtypes = [ctypes.c_void_p] 
    485485las.LASGuid_AsString.errcheck = check_value_free 
     486las.LASGuid_AsString.restype = ctypes.c_char_p 
    486487 
    487488las.LASGuid_Equals.argtypes = [ctypes.c_void_p, ctypes.c_void_p] 
     
    512513las.LASVLR_GetUserId.argtypes = [ctypes.c_void_p] 
    513514las.LASVLR_GetUserId.errcheck = check_value_free 
     515las.LASVLR_GetUserId.restype = ctypes.c_char_p 
    514516las.LASVLR_SetUserId.argtypes = [ctypes.c_void_p, ctypes.c_char_p] 
    515517las.LASVLR_SetUserId.errcheck = check_return 
     
    518520las.LASVLR_GetDescription.argtypes = [ctypes.c_void_p] 
    519521las.LASVLR_GetDescription.errcheck = check_value_free 
     522las.LASVLR_GetDescription.restype = ctypes.c_char_p 
    520523las.LASVLR_SetDescription.argtypes = [ctypes.c_void_p, ctypes.c_char_p] 
    521524las.LASVLR_SetDescription.errcheck = check_return 
     
    596599las.LASSRS_GetProj4.argtypes = [ctypes.c_void_p] 
    597600las.LASSRS_GetProj4.errcheck = check_value_free 
     601las.LASSRS_GetProj4.restype = ctypes.c_char_p 
    598602las.LASSRS_SetProj4.restype = ctypes.c_int 
    599603las.LASSRS_SetProj4.argtypes = [ctypes.c_void_p, ctypes.c_char_p] 
     
    602606las.LASSRS_GetWKT.argtypes = [ctypes.c_void_p] 
    603607las.LASSRS_GetWKT.errcheck = check_value_free 
     608las.LASSRS_GetWKT.restype = ctypes.c_char_p 
    604609las.LASSRS_SetWKT.restype = ctypes.c_int 
    605610las.LASSRS_SetWKT.argtypes = [ctypes.c_void_p, ctypes.c_char_p] 
Note: See TracChangeset for help on using the changeset viewer.