zoukankan      html  css  js  c++  java
  • Release COM Objects in AE

    When you codeing in Arc Engine, you need to consider the objects that you created, and if you leave so many unmanaged objects in the memory, and then you will find some wired activities.

    You may need:

      System.Runtime.InteropServices.Marshal.ReleaseComObject(pWorkFactory);

    Or, you may use the ComComReleaser in the ArcGIS assembly ESRI.ArcGIS.ADF.Connection.Local:

      ESRI.ArcGIS.ADF.ComReleaser.ReleaseCOMObject(pWorkFactory);

    You must release the cursors with used to reach the values, and the workspaces that you used to access data.

    When you get a cursor form a shpfile, then you will find a file like this in you disk:

      

    And if you use the WorkspaceEdit like that:

      IWorkspace workspace = ((IDataset)pFeatureClass_para).Workspace;
      IWorkspaceEdit workspaceEdit = workspace as IWorkspaceEdit;

      bool startEdit = workspaceEdit.IsBeingEdited();
      if (!startEdit)
      {
        workspaceEdit.StartEditing(false);
      }
      workspaceEdit.StartEditOperation();

    Then you will get a file like this:

      

    Then you need stop edit the work space, like this:

      workspaceEdit.StopEditOperation();
      startEdit = workspaceEdit.IsBeingEdited();
      while (startEdit)
      {
        workspaceEdit.StopEditing(true);
        startEdit = workspaceEdit.IsBeingEdited();
      }

  • 相关阅读:
    Linux下基于PAM机制的USB Key的制作
    IP-route管理路由
    Linux下CPU主板监控工具lm_sensors
    两个网卡隔离方法
    关机后内存的数据是怎么丢失的呢?
    6.0 移动端页面布局
    CyberPlayer 使用教程
    5.10 HTML5 音频和视频
    让Ecshop网店系统用户自动登陆
    設定 Bootstrap/SASS/Bower/gulp (Windows平台)
  • 原文地址:https://www.cnblogs.com/henyihanwobushi/p/2983083.html
Copyright © 2011-2022 走看看