X-Git-Url: https://git.distorted.org.uk/~mdw/clg/blobdiff_plain/985e276dfff3c1eedfe0e47c806116a2107dd0a3..5d18000c9ec1bc244622e352a4161b8836e8ac66:/gtk/gtktree.lisp diff --git a/gtk/gtktree.lisp b/gtk/gtktree.lisp index 55b8e43..efbfbcf 100644 --- a/gtk/gtktree.lisp +++ b/gtk/gtktree.lisp @@ -20,7 +20,7 @@ ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -;; $Id: gtktree.lisp,v 1.29 2007/08/20 11:20:21 espen Exp $ +;; $Id: gtktree.lisp,v 1.31 2007/10/17 14:47:10 espen Exp $ (in-package "GTK") @@ -255,11 +255,12 @@ location)) (defun %tree-path-to-vector (location) - (let ((indices (%tree-path-get-indices location)) - (depth (%tree-path-get-depth location))) - (if (null-pointer-p indices) - #() - (map-c-vector 'vector #'identity indices 'int depth)))) + (unless (null-pointer-p location) + (let ((indices (%tree-path-get-indices location)) + (depth (%tree-path-get-depth location))) + (if (null-pointer-p indices) + #() + (map-c-vector 'vector #'identity indices 'int depth))))) (defmacro %with-tree-path ((var path) &body body) (let* ((pointer-offset (adjust-offset (size-of 'int) 'pointer)) @@ -383,6 +384,11 @@ (model tree-model) (iter tree-iter :in/return) (path tree-path)) + +(defmethod allocate-foreign ((tree-iter tree-iter) &rest initargs) + (declare (ignore initargs)) + (let ((size (foreign-size (class-of tree-iter)))) + (slice-alloc size))) (defun ensure-tree-iter (model row) (etypecase row