- Timestamp:
- 11/08/18 17:10:53 (6 years ago)
- Location:
- branches/2931_OR-Tools_LP_MIP/HeuristicLab.ExtLibs/HeuristicLab.OrTools/6.9.0-pre/HeuristicLab.OrTools-6.9.0-pre
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2931_OR-Tools_LP_MIP/HeuristicLab.ExtLibs/HeuristicLab.OrTools/6.9.0-pre/HeuristicLab.OrTools-6.9.0-pre/Plugin.cs.frame
r16233 r16288 21 21 22 22 using System; 23 using System.IO; 24 using System.Linq; 25 using System.Runtime.InteropServices; 23 26 using HeuristicLab.PluginInfrastructure; 24 27 25 28 namespace HeuristicLab.OrTools { 29 26 30 [Plugin("HeuristicLab.OrTools", "Provides functionality of Google OR-Tools in HeuristicLab. Requires Windows 64-bit", "6.9.0.$WCREV$")] 27 31 [PluginFile("HeuristicLab.OrTools-6.9.0-pre.dll", PluginFileType.Assembly)] … … 30 34 [PluginFile("Google.OrTools.runtime.win-x64.dll", PluginFileType.NativeDll)] 31 35 [PluginFile("Google.OrTools_version.txt", PluginFileType.Data)] 36 [PluginFile("Google.Protobuf.dll", PluginFileType.Assembly)] 32 37 [PluginFile("glpk_4_65.dll", PluginFileType.NativeDll)] 33 38 [PluginFile("glpk-license.txt", PluginFileType.License)] 34 39 public class HeuristicLabOrToolsPlugin : PluginBase { 40 41 ~HeuristicLabOrToolsPlugin() { 42 OnUnload(); // HACK: remove once ticket #2961 is solved 43 } 44 45 public override void OnUnload() { 46 base.OnUnload(); 47 48 var thisClass = typeof(HeuristicLabOrToolsPlugin); 49 var dir = new FileInfo(thisClass.Assembly.Location).Directory; 50 if (dir == null) 51 return; 52 53 var nativeDlls = thisClass.GetCustomAttributes(typeof(PluginFileAttribute), true) 54 .Cast<PluginFileAttribute>() 55 .Where(pf => pf.FileType == PluginFileType.NativeDll) 56 .Select(pf => pf.FileName); 57 58 foreach (var nativeDll in dir.EnumerateFiles().Where(f => nativeDlls.Contains(f.Name))) { 59 var handle = LoadLibrary(nativeDll.FullName); 60 if (handle == IntPtr.Zero) 61 continue; 62 63 FreeLibrary(handle); // close handle obtained above 64 FreeLibrary(handle); // close implicitly obtained handle 65 } 66 } 67 68 [DllImport("kernel32.dll", SetLastError = true)] 69 [return: MarshalAs(UnmanagedType.Bool)] 70 private static extern bool FreeLibrary(IntPtr hModule); 71 72 [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Ansi)] 73 private static extern IntPtr LoadLibrary([MarshalAs(UnmanagedType.LPStr)]string lpFileName); 35 74 } 36 75 } -
branches/2931_OR-Tools_LP_MIP/HeuristicLab.ExtLibs/HeuristicLab.OrTools/6.9.0-pre/HeuristicLab.OrTools-6.9.0-pre/Properties/AssemblyInfo.cs
r16233 r16288 54 54 // [assembly: AssemblyVersion("1.0.*")] 55 55 [assembly: AssemblyVersion("6.8.0.0")] 56 [assembly: AssemblyFileVersion("6.8.0.16 172")]56 [assembly: AssemblyFileVersion("6.8.0.16233")]
Note: See TracChangeset
for help on using the changeset viewer.